List RSes once when getting old/new RSes in deployment e2e tests

This commit is contained in:
Janet Kuo
2016-06-01 14:14:40 -07:00
parent 06f742a5ea
commit 2ced966cd5
5 changed files with 52 additions and 36 deletions

View File

@@ -927,13 +927,11 @@ func testDeploymentLabelAdopted(f *framework.Framework) {
// There should be no old RSs (overlapping RS)
deployment, err := c.Extensions().Deployments(ns).Get(deploymentName)
Expect(err).NotTo(HaveOccurred())
oldRSs, allOldRSs, err := deploymentutil.GetOldReplicaSets(deployment, c)
oldRSs, allOldRSs, newRS, err := deploymentutil.GetAllReplicaSets(deployment, c)
Expect(err).NotTo(HaveOccurred())
Expect(len(oldRSs)).Should(Equal(0))
Expect(len(allOldRSs)).Should(Equal(0))
// New RS should contain pod-template-hash in its selector, label, and template label
newRS, err := deploymentutil.GetNewReplicaSet(deployment, c)
Expect(err).NotTo(HaveOccurred())
err = framework.CheckRSHashLabel(newRS)
Expect(err).NotTo(HaveOccurred())
// All pods targeted by the deployment should contain pod-template-hash in their labels, and there should be only 3 pods