-
Notifications
You must be signed in to change notification settings - Fork 187
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
Introduce Progressive status #974
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
darkowlzz
force-pushed
the
progressive-status
branch
from
December 5, 2022 10:19
9ef3b44
to
6e06819
Compare
pjbgf
reviewed
Dec 5, 2022
darkowlzz
force-pushed
the
progressive-status
branch
3 times, most recently
from
December 19, 2022 15:05
a91e37d
to
d4ade88
Compare
darkowlzz
force-pushed
the
progressive-status
branch
from
January 9, 2023 19:00
d4ade88
to
942c1d1
Compare
Update pkg/runtime for progressive status tooling. Signed-off-by: Sunny <[email protected]>
Replace the patch Helper with SerialPatcher which is used for progressive status patching. Update the tests to use progressive status reasons in tests. Add ProgressingWithRetry Reconciling reason for failed reconciliation result to indicate a finished failure operation. Signed-off-by: Sunny <[email protected]>
Signed-off-by: Sunny <[email protected]>
Signed-off-by: Sunny <[email protected]>
Signed-off-by: Sunny <[email protected]>
Signed-off-by: Sunny <[email protected]>
Signed-off-by: Sunny <[email protected]>
Signed-off-by: Sunny <[email protected]>
Signed-off-by: Sunny <[email protected]>
darkowlzz
force-pushed
the
progressive-status
branch
from
January 9, 2023 19:00
942c1d1
to
197a03b
Compare
hiddeco
approved these changes
Jan 10, 2023
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 all looks sensible to me, thank you @darkowlzz 🥇
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on fluxcd/pkg#422
This change introduces progressive status across all the reconcilers. It uses the helpers and checks proposed in fluxcd/pkg#422 to implement and verify the result of the change.
Mid-reconciliation status
Before this change, the reconcilers patched the target object of reconciliation only once, at the end of the reconciliation to report the final result of the reconciliation. The change in the status that took place during reconciliation were not reflected on the object. As described in #936, this resulted in stale status reported on the object. This also resulted in not reporting the progressive status of the reconciliation, which made it hard to understand if an object is undergoing reconciliation or not, refer #935 .
In order to perform multiple status updates on the object during reconciliation, a serial patcher was introduced in fluxcd/pkg#379 . This patcher is a drop-in replacement for the previous patch helper. It keeps track of the previously patched object and constructs subsequent patch based on the previously patched object.
To perform mid-reconciliation patching, all the sub-reconcilers need an instance of the patcher. This change extends the sub-reconciler function signature to allow passing the patcher.
When reconciliation of an object begins, the object is immediately marked with
Reconciling=True
. If it's a new object generation or reconciliation is manually requested using the reconcile annotation value, the reconciling status is patched and reported on the object.In the
reconcileStorage()
phase, if there's no artifact in the storage or an existing artifact disappeared from the storage, it is considered as a drift and is immediately reported on the object by patching the status.In the
reconcileSource()
phase, if a drift is detected in the artifact or the included artifact, it is again considered as a drift and is immediately reported on the object by patching the status.All the sub-reconciler tests have been updated accordingly with in-progress status condition check.
Reconciled status
In order to indicate that a reconciliation has resulted in a failure and reconciliation will be retried, the
Reconciling=True
condition is updated withProgressingWithRetry
reason. Kustomize-controller already does this.After a full reconciliation, if the reconciliation didn't succeed and
Reconciling
is stillTrue
, theComputeReconcileResult()
helper is updated to add theReconciling=True
reason withProgressingWithRetry
.Subsequent reconciliation updates the
Reconciling=True
reason withProgressing
to indicate that a reconciliation is in progress.SummarizeAndPatch()
has been updated to replace the previous patch helper with the serial patcher.Fixes #936, #935
Snippets showing the result of this change with status output:
Except for HelmRepository OCI reconciler, all the other reconcilers have similar implementations. Their status results should be similar.