-
Notifications
You must be signed in to change notification settings - Fork 213
sync: Distinguish between reconcile, initial, and sync states #133
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
sync: Distinguish between reconcile, initial, and sync states #133
Conversation
|
/assign @abhinavdahiya |
Identify what sort of change we are making to the cluster in order to better handle the different states. Does not change status reporting or the internal sync which will be in a follow up commit. The three states are: * Initializing - we haven't yet completed a payload * Updating - we're moving between two payloads of different versions * Reconciling - we're level on a completed payload The states will allow us to more efficiently reconcile, start faster, and be safer during upgrades.
1414460 to
584449f
Compare
|
Made the resource builder aware of the mode without actually changing any of our logic. |
Will allow different behavior based on whether we are reconciling, installing, or upgrading.
584449f to
a7c6983
Compare
| return builder.Do(ctx) | ||
| } | ||
|
|
||
| func hasNeverReachedLevel(cv *configv1.ClusterVersion) bool { |
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.
This is a stretch :P (sorry my brain just went there)
but, what if somebody overrides the desired more than 10 times, so there will be all partial and we will truncate to all partial because
cluster-version-operator/pkg/cvo/status.go
Lines 74 to 76 in 2a78a6c
| if len(config.Status.History) > 10 { | |
| config.Status.History = config.Status.History[:10] | |
| } |
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.
Hrm, we should leave the last completed. We should never prune to no completed. Good catch, will change
Currently history pruning could lose the last completed entry. To preserve the user's last successful outcome, always end the history with a completed entry if one exists. This also prevents the initializing state from being detected if the user triggers a lot of failed history changes.
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinavdahiya, smarterclayton The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Identify what sort of change we are making to the cluster in order
to better handle the different states. Does not change status reporting
or the internal sync which will be in a follow up commit.
The three states are:
The states will allow us to more efficiently reconcile, start faster,
and be safer during upgrades.
Extracted from #131