fix: remove revision==1 gate for scaleDown onsuccess. Fixes #4681#4730
fix: remove revision==1 gate for scaleDown onsuccess. Fixes #4681#4730SimbaKingjoe wants to merge 1 commit into
Conversation
The revision==1 check in promoteStable prevented workloadRef.scaleDown from triggering on any revision beyond the first. This means for BlueGreen + scaleDown: onsuccess, the referenced Deployment was only scaled down on the initial deploy and never again. Remove the revision gate so scaleDown fires on every stable promotion. Fixes argoproj#4681 Signed-off-by: Joe <simba@kingjoe.com> Signed-off-by: daixin1204 <daixin1204@gmail.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4730 +/- ##
==========================================
+ Coverage 85.03% 85.07% +0.03%
==========================================
Files 164 164
Lines 18989 18989
==========================================
+ Hits 16148 16154 +6
+ Misses 1993 1990 -3
+ Partials 848 845 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Published E2E Test Results 4 files 4 suites 3h 46m 30s ⏱️ For more details on these failures, see this check. Results for commit 21efebe. |
Published Unit Test Results2 470 tests 2 470 ✅ 3m 22s ⏱️ Results for commit 21efebe. |
|
Hello @SimbaKingjoe , scale down on success is expected to be used only during the initial migration from deployment to rollout and so the reason behind hardcoded value of 1. This change would not only try to trigger scale down even after the initial migration it also does not fix the core issue mentioned in #4681 i.e Initial deploy bypasses PostPromotionAnalysis, creating a permanent dead state. Could you please recheck? |


Summary
Remove the
revision == 1gate frompromoteStable()soworkloadRef.scaleDown: onsuccesstriggers on every stable promotion, not just the initial deploy.Background
When using BlueGreen strategy with
workloadRef.scaleDown: onsuccess, the referenced Deployment should be scaled down every time a new ReplicaSet is promoted to stable. However, the check inpromoteStable()(rollout/sync.go:1040) includedrevision == 1, restricting the scale-down to only the very first deployment.For revision >= 2,
shouldFullPromote()correctly runs PostPromotionAnalysis (if configured), returns "Completed blue-green update", and callspromoteStable(), but the scale-down is silently skipped becauserevision != 1.Modifications
rollout/sync.go: Removerevision == 1 &&from the scaleDown condition inpromoteStable()rollout/sync_test.go: AddTestScaleDownDeploymentOnSuccessRevision2verifying scale-down triggers on revision 2Verification
Checklist:
fix: remove revision==1 gate for scaleDown onsuccess