Implement MinReadySeconds for Deployment

This commit is contained in:
Janet Kuo
2015-11-11 15:22:57 -08:00
parent b6f68df3c8
commit 8fb0caa15b
6 changed files with 106 additions and 11 deletions

View File

@@ -208,8 +208,9 @@ func (d *DeploymentController) reconcileOldRCs(allRCs []*api.ReplicationControll
}
// Check if we can scale down.
minAvailable := deployment.Spec.Replicas - maxUnavailable
minReadySeconds := deployment.Spec.Strategy.RollingUpdate.MinReadySeconds
// Find the number of ready pods.
readyPodCount, err := deploymentutil.GetAvailablePodsForRCs(d.client, allRCs)
readyPodCount, err := deploymentutil.GetAvailablePodsForRCs(d.client, allRCs, minReadySeconds)
if err != nil {
return false, fmt.Errorf("could not find available pods: %v", err)
}