test: wait for complete rollouts in WaitForDeploymentStatusValid

This commit is contained in:
Michail Kargakis
2016-10-17 12:40:05 +02:00
parent 57a47b6af5
commit 71df8f6544
2 changed files with 21 additions and 8 deletions

View File

@@ -2896,7 +2896,18 @@ func WaitForDeploymentStatusValid(c clientset.Interface, d *extensions.Deploymen
Logf(reason)
return false, nil
}
return true, nil
// When the deployment status and its underlying resources reach the desired state, we're done
if deployment.Status.Replicas == deployment.Spec.Replicas &&
deployment.Status.UpdatedReplicas == deployment.Spec.Replicas &&
deployment.Status.AvailableReplicas == deployment.Spec.Replicas {
return true, nil
}
reason = fmt.Sprintf("deployment status: %#v", deployment.Status)
Logf(reason)
return false, nil
})
if err == wait.ErrWaitTimeout {
@@ -2960,9 +2971,7 @@ func WaitForDeploymentStatus(c clientset.Interface, d *extensions.Deployment) er
// When the deployment status and its underlying resources reach the desired state, we're done
if deployment.Status.Replicas == deployment.Spec.Replicas &&
deployment.Status.UpdatedReplicas == deployment.Spec.Replicas &&
deploymentutil.GetReplicaCountForReplicaSets(oldRSs) == 0 &&
deploymentutil.GetReplicaCountForReplicaSets([]*extensions.ReplicaSet{newRS}) == deployment.Spec.Replicas {
deployment.Status.UpdatedReplicas == deployment.Spec.Replicas {
return true, nil
}
return false, nil