fix creating secrets for rotation users#2863
Merged
Merged
Conversation
FxKu
requested review from
Jan-M,
hughcapet,
idanovinda,
jopadi,
macedigital and
sdudoladov
as code owners
February 12, 2025 14:24
Contributor
|
👍 |
1 similar comment
Contributor
Author
|
👍 |
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.
In #2657 a bug was introduced which produces additional secrets for rotation users which are redundant to the original secret. Before syncing secrets we usually initialize the user list to get the desired state.
On UPDATE events we only needed to sync secrets in case the user setup changed.
initUsersandsyncSecretswere called in one if block. The behavior was changed to have two if blocks where secrets can be synced on annotations diff while skipping user initializing. Therefore, the current pgUser list is used which contains the rotation users instead of the original ones.We better return to the previous behavior incl. the annotation diff check, even though we would probably always init users then because UPDATEs are usually tiggered from deployments changing the deployment-time annotation.
Another quick hack would be to not generate a secret for rotation users (when
Rotatedflag is true), but since rotation users replace their original counterparts in the pgUsers list, we would then not sync the corresponding secrets.In a first step I extended the e2e test without changing any other code (quick hack only as a comment) to reproduce the bug.