Move MinReadySeconds out of RollingUpdateDeployment

This commit is contained in:
mqliang
2016-01-31 21:59:58 +08:00
parent ae2aece9af
commit c4a1ab42e3
13 changed files with 1105 additions and 1107 deletions

View File

@@ -799,7 +799,7 @@ func (dc *DeploymentController) reconcileOldRCs(allRCs []*api.ReplicationControl
}
// Check if we can scale down.
minAvailable := deployment.Spec.Replicas - maxUnavailable
minReadySeconds := deployment.Spec.Strategy.RollingUpdate.MinReadySeconds
minReadySeconds := deployment.Spec.MinReadySeconds
// Check the expectations of deployment before counting available pods
dKey, err := controller.KeyFunc(&deployment)
if err != nil {
@@ -923,10 +923,7 @@ func (dc *DeploymentController) updateDeploymentStatus(allRCs []*api.Replication
func (dc *DeploymentController) calculateStatus(allRCs []*api.ReplicationController, newRC *api.ReplicationController, deployment extensions.Deployment) (totalReplicas, updatedReplicas, availableReplicas, unavailableReplicas int, err error) {
totalReplicas = deploymentutil.GetReplicaCountForRCs(allRCs)
updatedReplicas = deploymentutil.GetReplicaCountForRCs([]*api.ReplicationController{newRC})
minReadySeconds := 0
if deployment.Spec.Strategy.Type == extensions.RollingUpdateDeploymentStrategyType {
minReadySeconds = deployment.Spec.Strategy.RollingUpdate.MinReadySeconds
}
minReadySeconds := deployment.Spec.MinReadySeconds
availableReplicas, err = deploymentutil.GetAvailablePodsForRCs(dc.client, allRCs, minReadySeconds)
if err != nil {
err = fmt.Errorf("failed to count available pods: %v", err)