Skip to content
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

PostRenderersDigest observation improvements #972

Merged
merged 1 commit into from
May 9, 2024

Conversation

darkowlzz
Copy link
Contributor

@darkowlzz darkowlzz commented May 8, 2024

This adds a minor improvement to the implementation of the observing the post renderers digest in #965 by moving the observation set/update code from summarize() to atomic release reconciliation. summarize() is for summarizing the status conditions only and it is called by all the action sub-reconcilers. In addition, the post renderers digest value check is performed only for unprocessed new configuration. This is needed to prevent the atomic reconciliation from getting stuck in a loop when there are multiple upgrades, for example due to a config difference and a digest mismatch, and since the digest gets updated at the very end of a successful reconciliation, the release can get stuck. This make sure that the digest is checked only for unprocessed generation of the object. This behavior is only associated with the changes introduced here. Previously, the observation got updated early within the summarize() which got around such issue.

Also, adds more tests for various scenarios involving post renderers.

@darkowlzz darkowlzz force-pushed the improve-postrenderer-tracking branch from 7e2d085 to c906e99 Compare May 8, 2024 18:21
Comment on lines -53 to -60
Patch: `|-
apiVersion: apps/v1
kind: Deployment
metadata:
name: test
spec:
replicas: 2
`,
Copy link
Contributor Author

@darkowlzz darkowlzz May 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was causing patch parsing failure when processed by atomic reconciler, due to |- and also due to the indentations. Removing the indentation resolved the parsing failure.

@darkowlzz darkowlzz force-pushed the improve-postrenderer-tracking branch from c906e99 to cd9e522 Compare May 9, 2024 10:45
Move the post renderers digest set/update code from summarize() to
atomic release reconciler in order to update the observation only at the
end of a successful reconciliation. summarize() is for summarizing the
status conditions and is also called by all the other action
sub-reconcilers, which can update the post renderers digest observation
too early.
Updating the observed post renderers digest at the very end of a
reconciliation introduces an issue where a digest mismatch in
DetermineReleaseState() could result in the release to get stuck in a
loop as even after running an upgrade due to post renderers value, the
new observation isn't reflected immediately in the middle of atomic
reconciliation. This can be solved by checking post renderers digest
value only for new configurations where the object generation and the
ready status condition observed generations don't match, in other words
when the generation of a configuration has not be processed. This
assumes that an upgrade due to any other reason also takes into account
the post renderers value and need not be checked separately for the same
config generation.

Signed-off-by: Sunny <github@darkowlzz.space>
@darkowlzz darkowlzz force-pushed the improve-postrenderer-tracking branch from cd9e522 to 63f7a76 Compare May 9, 2024 11:01
@darkowlzz
Copy link
Contributor Author

darkowlzz commented May 9, 2024

I have added some more test scenarios involving post renderers in atomic release reconciler.

Did more manual testing observing the behavior, everything seems as before and correct.
Also performed some upgrade test from v2beta2 to v2 with all the recent fixes, version upgrade doesn't cause helm upgrade of the existing releases. The releases remain in sync.

@darkowlzz darkowlzz marked this pull request as ready for review May 9, 2024 12:04
@stefanprodan stefanprodan added the backport:release/v1.0.x To be backported to release/v1.0.x label May 9, 2024
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @darkowlzz 🏅

@stefanprodan stefanprodan merged commit f88b3be into main May 9, 2024
7 checks passed
@stefanprodan stefanprodan deleted the improve-postrenderer-tracking branch May 9, 2024 12:21
@fluxcdbot
Copy link
Member

Successfully created backport PR for release/v1.0.x:

Copy link
Member

@souleb souleb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @darkowlzz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:release/v1.0.x To be backported to release/v1.0.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants