fix: correct MaxSurge default assignment in SetDefaultDeploymentStrategy#332
fix: correct MaxSurge default assignment in SetDefaultDeploymentStrategy#332Xio-Shark wants to merge 1 commit intoopenkruise:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @Xio-Shark! It looks like this is your first PR to openkruise/rollouts 🎉 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #332 +/- ##
=======================================
Coverage 51.38% 51.38%
=======================================
Files 66 66
Lines 8559 8559
=======================================
Hits 4398 4398
Misses 3575 3575
Partials 586 586
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The default value for MaxSurge was incorrectly assigned to MaxUnavailable, causing MaxSurge to remain nil when not explicitly set. This could lead to unexpected behavior in the rolling update strategy where maxSurge==0 fallback logic would always trigger. Made-with: Cursor Signed-off-by: Teng Yanxi <151488904+Xio-Shark@users.noreply.github.com>
2303413 to
c2d9d8c
Compare
Summary
Fix a bug in
SetDefaultDeploymentStrategywhere the default value forMaxSurgewas incorrectly assigned toMaxUnavailableinstead ofMaxSurge.Before (buggy):
After (fixed):
Impact
When
MaxSurgewas not explicitly set, the function would:MaxUnavailabledefault with themaxSurgevalueMaxSurgeas nilmaxSurge==0 && maxUnavailable==0fallback logic to incorrectly triggerTest
go build ./...passesgo vet ./...passesMade with Cursor