fix: clear Result when Reconcile returns an error#880
Open
alliasgher wants to merge 1 commit intofluxcd:mainfrom
Open
fix: clear Result when Reconcile returns an error#880alliasgher wants to merge 1 commit intofluxcd:mainfrom
alliasgher wants to merge 1 commit intofluxcd:mainfrom
Conversation
Member
|
We should fix this inside the |
ff6331e to
a61c052
Compare
Member
|
@alliasgher the commit should be: The fix should happen inside the return nil, err |
Signed-off-by: Ali <alliasgher123@gmail.com> Assisted-by: claude-sonnet-4-6
a61c052 to
f49203b
Compare
Author
@stefanprodan done! |
This file contains hidden or 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
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.
Summary
Both
ImageRepositoryReconciler.ReconcileandImagePolicyReconciler.Reconcilewrap the sub-reconciler with a named-return form that always emits both values:controller-runtime emits the warning referenced in #661 when a
Reconcilecall returns both a non-zeroResultand a non-nil error — theResultis ignored in that case and the object is re-queued with the error's exponential backoff. Populating aRequeueAfterand then returning an error gives the misleading impression that the caller's requested interval applies.Drop the
Resultwhen there is an error so controller-runtime sees(ctrl.Result{}, retErr)and the warning no longer fires. Behaviour after the change is what controller-runtime was doing anyway (theResultwas being discarded); this just avoids the log noise.Fixes #661
Signed-off-by: Ali alliasgher123@gmail.com