Merge pull request #110069 from FillZpp/fix-statefulset-maxunavailable-less-than-one

Fix maxUnavailable of StatefulSet should not less than 1
This commit is contained in:
Kubernetes Prow Robot
2022-05-20 16:50:12 -07:00
committed by GitHub

View File

@@ -618,7 +618,11 @@ func updateStatefulSetAfterInvariantEstablished(
if err != nil {
return &status, err
}
// maxUnavailable might be zero for small percentage without round up.
// So we have to enforce it not to be less than 1.
if maxUnavailable < 1 {
maxUnavailable = 1
}
}
// Collect all targets in the range between the 0 and Spec.Replicas. Count any targets in that range