Conversation
…ersion The plan executor patches status mid-reconcile (task/plan completion), bumping resourceVersion. completePlan/failPlan then tried to patch status using the statusBase from the start of Reconcile, which carried the old resourceVersion. This caused guaranteed optimistic lock conflicts, leaving deployments permanently stuck in Upgrading phase. Fix: completePlan and failPlan now re-read the object via r.Get before building their patch base, ensuring a fresh resourceVersion. The stale statusBase parameter is removed from both functions and drivePlan. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.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.
Summary
Fixes deployments permanently stuck in
Upgradingphase after plan completion.Root cause
The plan executor patches status mid-reconcile (marking tasks and plans complete), bumping
resourceVersionon the API server.completePlanandfailPlanthen tried to patch status using thestatusBasecomputed at the start ofReconcile, which carried the oldresourceVersion. This caused guaranteed optimistic lock conflicts on every reconcile, creating an infinite retry loop.This is a structural bug, not specific to the InPlace migration. Any plan that completes tasks would hit this.
Fix
completePlanandfailPlannow re-read the object viar.Getbefore building their patch base, ensuring a freshresourceVersion. The stalestatusBaseparameter is removed from both functions anddrivePlan.Also adds a TODO on
detectDeploymentNeededfor guarding against emptyincumbentNodes(plans with empty node lists complete as no-ops).Test plan
TestCompletePlan_ClearsRolloutInProgress— no longer passes statusBaseTestFailPlan_ClearsRolloutInProgress— no longer passes statusBasemake test)make lint)🤖 Generated with Claude Code