Commit d2c9d519 authored by Janet Kuo's avatar Janet Kuo

Remove racy check in waitForDeploymentStatus; wait for underlying resources to…

Remove racy check in waitForDeploymentStatus; wait for underlying resources to reach the desired state instead
parent 1e680c9d
...@@ -2133,19 +2133,11 @@ func waitForDeploymentStatus(c clientset.Interface, ns, deploymentName string, d ...@@ -2133,19 +2133,11 @@ func waitForDeploymentStatus(c clientset.Interface, ns, deploymentName string, d
return false, fmt.Errorf("total pods available: %d, less than the min required: %d", totalAvailable, minAvailable) return false, fmt.Errorf("total pods available: %d, less than the min required: %d", totalAvailable, minAvailable)
} }
// When the deployment status and its underlying resources reach the desired state, we're done
if deployment.Status.Replicas == desiredUpdatedReplicas && if deployment.Status.Replicas == desiredUpdatedReplicas &&
deployment.Status.UpdatedReplicas == desiredUpdatedReplicas { deployment.Status.UpdatedReplicas == desiredUpdatedReplicas &&
// Verify replica sets. deploymentutil.GetReplicaCountForReplicaSets(oldRSs) == 0 &&
if deploymentutil.GetReplicaCountForReplicaSets(oldRSs) != 0 { deploymentutil.GetReplicaCountForReplicaSets([]*extensions.ReplicaSet{newRS}) == desiredUpdatedReplicas {
logReplicaSetsOfDeployment(deploymentName, oldRSs, newRS)
logPodsOfReplicaSets(c, allRSs, minReadySeconds)
return false, fmt.Errorf("old replica sets are not fully scaled down")
}
if deploymentutil.GetReplicaCountForReplicaSets([]*extensions.ReplicaSet{newRS}) != desiredUpdatedReplicas {
logReplicaSetsOfDeployment(deploymentName, oldRSs, newRS)
logPodsOfReplicaSets(c, allRSs, minReadySeconds)
return false, fmt.Errorf("new replica sets is not fully scaled up")
}
return true, nil return true, nil
} }
return false, nil return false, nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment