fix: recreate deployments with stale legacy-managed env vars#159
Open
bigbluechief wants to merge 1 commit intomainfrom
Open
fix: recreate deployments with stale legacy-managed env vars#159bigbluechief wants to merge 1 commit intomainfrom
bigbluechief wants to merge 1 commit intomainfrom
Conversation
We have observed pods keeping old env vars after spec changes, which can cause invalid runtime config (for example stale servlet/webflux base paths). Root cause is split SSA ownership in managedFields: old deployments still have env entries owned by the legacy field manager `flaisapplicationreconciler`. When desired state removes those vars, normal apply from the current reconciler may not clear them. This change does two things: - set `fieldManager = "applicationreconciler"` in ApplicationReconciler to keep future SSA ownership stable - in DeploymentDR, detect stale env vars (`actual - desired`, per container) and recreate deployment when both conditions are true: - legacy apply manager is present - stale env vars exist Added unit tests for: - recreate with legacy manager + stale env vars - no recreate without legacy manager - no recreate when env is already in sync - container-aware stale env identity Potential downsides: - affected deployments may roll once due to delete/recreate when healed - manually added env vars not present in desired state can be removed during healing (expected for desired-state reconciliation) - detection currently targets known legacy manager names; more can be added if historical manager variants are discovered
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.
We have observed pods keeping old env vars after spec changes, which can cause invalid runtime config (for example stale servlet/webflux base paths).
Root cause is split SSA ownership in managedFields: old deployments still have env entries owned by the legacy field manager
flaisapplicationreconciler.When desired state removes those vars, normal apply from the current reconciler may not clear them.
This change does two things:
fieldManager = "applicationreconciler"in ApplicationReconciler to keep future SSA ownership stableactual - desired, per container) and recreate deployment when both conditions are true:Added unit tests for:
Potential downsides: