-
Notifications
You must be signed in to change notification settings - Fork 164
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
Conversation
7e2d085
to
c906e99
Compare
Patch: `|- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: test | ||
spec: | ||
replicas: 2 | ||
`, |
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 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.
c906e99
to
cd9e522
Compare
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>
cd9e522
to
63f7a76
Compare
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. |
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.
LGTM
Thanks @darkowlzz 🏅
Successfully created backport PR for |
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.
LGTM! Thanks @darkowlzz
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 thesummarize()
which got around such issue.Also, adds more tests for various scenarios involving post renderers.