fix: do not run ApplyTemplate for immutable secrets in mutationFunc#5110
Merged
Skarlso merged 1 commit intoexternal-secrets:mainfrom Aug 8, 2025
Merged
fix: do not run ApplyTemplate for immutable secrets in mutationFunc#5110Skarlso merged 1 commit intoexternal-secrets:mainfrom
mutationFunc#5110Skarlso merged 1 commit intoexternal-secrets:mainfrom
Conversation
This makes sure that `mutationFunc` only calls ApplyTemplate (and updates the Secret) when the secret under check is freshly created and not immutable. Previously, it always ran the ApplyTemplate and that lead to races. fix external-secrets#4976 To verify fix, see reproducer at external-secrets#4976 (comment) Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
|
Contributor
|
/ok-to-test sha=b427491cdc91aba222ec572c6ea730c8eccf850f |
Contributor
Skarlso
approved these changes
Aug 8, 2025
alliseeisgold
pushed a commit
to alliseeisgold/external-secrets
that referenced
this pull request
Aug 25, 2025
…external-secrets#5110) This makes sure that `mutationFunc` only calls ApplyTemplate (and updates the Secret) when the secret under check is freshly created and not immutable. Previously, it always ran the ApplyTemplate and that lead to races. fix external-secrets#4976 To verify fix, see reproducer at external-secrets#4976 (comment) Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
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.



Problem Statement
When reconciling a recently created ExternalSecret it is possible that the Status subresource is not in the cache causing this condition to fail. The operator will then try and fail to update an immutable ExternalSecret.
Related Issue
fix #4976
To verify fix, see reproducer at #4976 (comment)
Proposed Changes
This makes sure that
mutationFunconly calls ApplyTemplate (and updates the Secret) when the secret under check is freshly created and not immutable. Previously, it always ran the ApplyTemplate and that lead to races.Checklist
git commit --signoffmake testmake reviewable