-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delayed cronjob re-enabling after cluster upgrade/resume #593
Conversation
116a7b6
to
be39cd1
Compare
9581fa4
to
18fa540
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me :)
Aren't any tests affected by not immediately re-enabling the snapshot job?
45ca945
to
f63f530
Compare
@@ -344,3 +347,36 @@ async def resume_sql_exporter_configmap( | |||
""" | |||
await raise_on_namespace_terminating(namespace) | |||
await update_sql_exporter_configmap(namespace, name, logger) | |||
|
|||
|
|||
@kopf.timer( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool solution 👍
26037cb
to
bd1496b
Compare
use timer to unsuspend the cronjob
bd1496b
to
e7fd71e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 💯
Summary of changes
The
AfterClusterUpdateSubHandler
is now split in two. The first one is as it used to be and the second one is to re-enable the cronjob.This new handler is not added to the
depends_on
list because it can be delayed by 1h in some cases. It means that the success notification will be sent and the handler will be executed later (if an issue occur, theerror
decorator will do the trick).The delay is applied if
delay_cronjob=True
is in the status. It is set to True in theupgrade
handler.Checklist
CHANGES.rst