Merge pull request #40261 from kargakis/fix-deployment-completeness
Automatic merge from submit-queue controller: old pods should block deployment completeness Fixes https://github.com/kubernetes/kubernetes/issues/40207
This commit is contained in:
@@ -816,9 +816,10 @@ func IsRollingUpdate(deployment *extensions.Deployment) bool {
|
||||
}
|
||||
|
||||
// DeploymentComplete considers a deployment to be complete once its desired replicas equals its
|
||||
// updatedReplicas and it doesn't violate minimum availability.
|
||||
// updatedReplicas, no old pods are running, and it doesn't violate minimum availability.
|
||||
func DeploymentComplete(deployment *extensions.Deployment, newStatus *extensions.DeploymentStatus) bool {
|
||||
return newStatus.UpdatedReplicas == *(deployment.Spec.Replicas) &&
|
||||
newStatus.Replicas == *(deployment.Spec.Replicas) &&
|
||||
newStatus.AvailableReplicas >= *(deployment.Spec.Replicas)-MaxUnavailable(*deployment) &&
|
||||
newStatus.ObservedGeneration >= deployment.Generation
|
||||
}
|
||||
|
Reference in New Issue
Block a user