Commit 9a37fe6d authored by Christian Bell's avatar Christian Bell

[Federation] Deployments unaware of ReadyReplicas

The Deployment controller was not propagating ReadyReplicas to underlying clusters causing these errors: ``` Error syncing cluster controller: Deployment.apps "federation-deployment" is invalid: status.availableReplicas: Invalid value: 5: cannot be greater than readyReplicas ``` This was caught in e2e testing and is a 1.6 regression for support that was added in #37959. Without this fix, users will be unable to scale up their deployments.
parent 486ec2b7
...@@ -596,11 +596,13 @@ func (fdc *DeploymentController) reconcileDeployment(key string) (reconciliation ...@@ -596,11 +596,13 @@ func (fdc *DeploymentController) reconcileDeployment(key string) (reconciliation
fedStatus.Replicas += currentLd.Status.Replicas fedStatus.Replicas += currentLd.Status.Replicas
fedStatus.AvailableReplicas += currentLd.Status.AvailableReplicas fedStatus.AvailableReplicas += currentLd.Status.AvailableReplicas
fedStatus.UnavailableReplicas += currentLd.Status.UnavailableReplicas fedStatus.UnavailableReplicas += currentLd.Status.UnavailableReplicas
fedStatus.ReadyReplicas += currentLd.Status.ReadyReplicas
} }
} }
if fedStatus.Replicas != fd.Status.Replicas || if fedStatus.Replicas != fd.Status.Replicas ||
fedStatus.AvailableReplicas != fd.Status.AvailableReplicas || fedStatus.AvailableReplicas != fd.Status.AvailableReplicas ||
fedStatus.UnavailableReplicas != fd.Status.UnavailableReplicas { fedStatus.UnavailableReplicas != fd.Status.UnavailableReplicas ||
fedStatus.ReadyReplicas != fd.Status.ReadyReplicas {
fd.Status = fedStatus fd.Status = fedStatus
_, err = fdc.fedClient.Extensions().Deployments(fd.Namespace).UpdateStatus(fd) _, err = fdc.fedClient.Extensions().Deployments(fd.Namespace).UpdateStatus(fd)
if err != nil { if err != nil {
......
...@@ -245,11 +245,11 @@ func updateDeploymentOrFail(clientset *fedclientset.Clientset, namespace string) ...@@ -245,11 +245,11 @@ func updateDeploymentOrFail(clientset *fedclientset.Clientset, namespace string)
deployment := newDeploymentForFed(namespace, FederationDeploymentName, 15) deployment := newDeploymentForFed(namespace, FederationDeploymentName, 15)
newRs, err := clientset.Deployments(namespace).Update(deployment) newDeployment, err := clientset.Deployments(namespace).Update(deployment)
framework.ExpectNoError(err, "Updating deployment %q in namespace %q", deployment.Name, namespace) framework.ExpectNoError(err, "Updating deployment %q in namespace %q", deployment.Name, namespace)
By(fmt.Sprintf("Successfully updated federation deployment %q in namespace %q", FederationDeploymentName, namespace)) By(fmt.Sprintf("Successfully updated federation deployment %q in namespace %q", FederationDeploymentName, namespace))
return newRs return newDeployment
} }
func deleteDeploymentOrFail(clientset *fedclientset.Clientset, nsName string, deploymentName string, orphanDependents *bool) { func deleteDeploymentOrFail(clientset *fedclientset.Clientset, nsName string, deploymentName string, orphanDependents *bool) {
......
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