diff --git a/test/e2e/deployment.go b/test/e2e/deployment.go index 149c58ce7b6..ca7fc740e08 100644 --- a/test/e2e/deployment.go +++ b/test/e2e/deployment.go @@ -1194,27 +1194,27 @@ func testOverlappingDeployment(f *framework.Framework) { podLabels = map[string]string{"name": nginxImageName} By(fmt.Sprintf("Creating deployment %q", deploymentName)) d = newDeployment(deploymentName, replicas, podLabels, nginxImageName, nginxImage, extensions.RollingUpdateDeploymentStrategyType, nil) - deployLater, err := c.Extensions().Deployments(ns).Create(d) + thirdDeployment, err := c.Extensions().Deployments(ns).Create(d) Expect(err).NotTo(HaveOccurred(), "Failed creating the third deployment") // Wait for it to be updated to revision 1 - err = framework.WaitForDeploymentRevisionAndImage(c, ns, deployLater.Name, "1", nginxImage) + err = framework.WaitForDeploymentRevisionAndImage(c, ns, thirdDeployment.Name, "1", nginxImage) Expect(err).NotTo(HaveOccurred(), "The third deployment failed to update to revision 1") // Update the second deployment's selector to make it overlap with the third deployment By(fmt.Sprintf("Updating deployment %q selector to make it overlap with existing one", deployOverlapping.Name)) deployOverlapping, err = framework.UpdateDeploymentWithRetries(c, ns, deployOverlapping.Name, func(update *extensions.Deployment) { - update.Spec.Selector = deployLater.Spec.Selector - update.Spec.Template.Labels = deployLater.Spec.Template.Labels + update.Spec.Selector = thirdDeployment.Spec.Selector + update.Spec.Template.Labels = thirdDeployment.Spec.Template.Labels update.Spec.Template.Spec.Containers[0].Image = redisImage }) Expect(err).NotTo(HaveOccurred()) // Wait for overlapping annotation updated to both deployments - By("Waiting for the third deployment to have the overlapping annotation") - err = framework.WaitForOverlappingAnnotationMatch(c, ns, deployLater.Name, deployOverlapping.Name) - Expect(err).NotTo(HaveOccurred(), "Failed to update the third deployment's overlapping annotation") - err = framework.WaitForOverlappingAnnotationMatch(c, ns, deployOverlapping.Name, "") + By("Waiting for the second deployment to have the overlapping annotation") + err = framework.WaitForOverlappingAnnotationMatch(c, ns, deployOverlapping.Name, thirdDeployment.Name) + Expect(err).NotTo(HaveOccurred(), "Failed to update the second deployment's overlapping annotation") + err = framework.WaitForOverlappingAnnotationMatch(c, ns, thirdDeployment.Name, "") Expect(err).NotTo(HaveOccurred(), "The deployment that holds the oldest selector shouldn't have the overlapping annotation") // The second deployment shouldn't be synced