Closed dkeven closed 1 year ago
/cc @stoneshi-yunify @pixiake
@dkeven: GitHub didn't allow me to request PR reviews from the following users: stoneshi-yunify.
Note that only kubesphere members and repo collaborators can review this PR, and authors cannot review their own PRs.
/cc @stoneshi-yunify
@dkeven: GitHub didn't allow me to request PR reviews from the following users: stoneshi-yunify.
Note that only kubesphere members and repo collaborators can review this PR, and authors cannot review their own PRs.
@stoneshi-yunify: changing LGTM is restricted to collaborators
/lgtm /approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: dkeven, pixiake, stoneshi-yunify
The full list of commands accepted by this bot can be found here.
The pull request process is described here
What type of PR is this?
What this PR does / Why we need it:
If controller has not reconciled for a long time, e.g. the pod failed to start, a missed schedule might trigger an immediate run at the wrong time, because of the simple comparison in the current implementation:
schedule.Next(lastScheduleTime).Before(time.Now())
For example, if a plan is scheduled at the start of every hour (9:00, 10:00...), if the controller has been down for more than 1 hour, an audit task will be created immediately as the controller comes back, no matter what time it is.
A missed schedule check is added in this PR, and if the last schedule is missed for too long, it will be skipped.