Skip to content
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

fix(maxRetries): avoid chicken and egg problem when maxRetries is set to 0 for initial CR reconciles #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

agill17
Copy link
Contributor

@agill17 agill17 commented Jan 9, 2021

This fixes the use case when a user wants to install a CR with only 1 retry. This is done by setting maxRetries to 0. It works like backOffLimit in a k8s job.

Bug was, when spec.maxRetries is set to 0 and this is first reconcile, controller was checking the status failureCount number which by default is 0. So when both are 0, the controller would not reconcile the CR.

Every new reconcile for every new CR, the failureCount in status will always start with 0, so we need to exclude failureCount check when checking whether a CR maxRetries has been met.

@agill17 agill17 requested a review from RichardMills January 9, 2021 02:21
@agill17 agill17 self-assigned this Jan 9, 2021
@agill17 agill17 added the bug Something isn't working label Jan 9, 2021
@agill17 agill17 changed the title fix the chicken and egg problem when maxRetries is set to 0 for initial CR reconciles fix(maxRetries): avoid chicken and egg problem when maxRetries is set to 0 for initial CR reconciles Jan 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant