Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Before this PR, if scheduled time was every hour, if a Cleaner instance was reconciled at 1:00:01, that Cleaner instance was not processed because reconciliation happened a second later than the scheduled one. If multiple Cleaner instances are all scheduled to be processed at the same time, this was causing problem with some Cleaner instances never processed. This PR introduces a window aroung the schedule time. By default this window is set to 15 seconds (though it is configurable using arg `jitter-window`). If reconciliation happens within jitter Window, a cleaner instance is still processed. To test this PR I created 8 Cleaner instances all scheduled at the same time: ```bash kubectl get cleaner -A NAME AGE completed-jobs 6m47s completed-pods 6m47s stale-persistent-volume-claim 6m47s unbound-peristent-volumes 6m47s unused-configmaps 6m47s unused-roles 6m47s unused-secrets 6m47s unused-service-accounts 6m46s ``` A report instance for each one of them was created ```bash kubectl get report -A NAME AGE completed-jobs 4m57s completed-pods 4m58s stale-persistent-volume-claim 4m58s unbound-peristent-volumes 4m58s unused-configmaps 4m57s unused-roles 4m57s unused-secrets 4m58s unused-service-accounts 4m58s ```
- Loading branch information