Skip to content

Commit 2303413

Browse files
committed
fix: correct MaxSurge default assignment in SetDefaultDeploymentStrategy
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
1 parent 8416512 commit 2303413

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

api/v1beta1/deployment_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func SetDefaultDeploymentStrategy(strategy *DeploymentStrategy) {
100100
if strategy.RollingUpdate.MaxSurge == nil {
101101
// Set MaxSurge as 25% by default
102102
maxSurge := intstr.FromString("25%")
103-
strategy.RollingUpdate.MaxUnavailable = &maxSurge
103+
strategy.RollingUpdate.MaxSurge = &maxSurge
104104
}
105105

106106
// Cannot allow maxSurge==0 && MaxUnavailable==0, otherwise, no pod can be updated when rolling update.

0 commit comments

Comments
 (0)