Handle maxUnavailable larger than spec.replicas

This commit is contained in:
Haoran Wang
2017-03-30 17:11:52 +08:00
parent acca01bcc2
commit b6aadd2b7e
2 changed files with 80 additions and 0 deletions

View File

@@ -415,6 +415,9 @@ func MaxUnavailable(deployment extensions.Deployment) int32 {
}
// Error caught by validation
_, maxUnavailable, _ := ResolveFenceposts(deployment.Spec.Strategy.RollingUpdate.MaxSurge, deployment.Spec.Strategy.RollingUpdate.MaxUnavailable, *(deployment.Spec.Replicas))
if maxUnavailable > *deployment.Spec.Replicas {
return *deployment.Spec.Replicas
}
return maxUnavailable
}