From cf07c106533f132b121ca2d82fb3139a00e26b97 Mon Sep 17 00:00:00 2001 From: "Madhusudan.C.S" Date: Tue, 7 Mar 2017 20:50:08 -0800 Subject: [PATCH] [Federation] Use and return created replicaset instead of the passed object. Passed replicaset object doesn't contain object name, but has a prefix set in `GenerateName`. However, we need to operate on the object name later to uniquely identified the created object. So we need the created object with the name set by the API server. --- test/e2e_federation/replicaset.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/e2e_federation/replicaset.go b/test/e2e_federation/replicaset.go index 183d48304a6..ef239599f22 100644 --- a/test/e2e_federation/replicaset.go +++ b/test/e2e_federation/replicaset.go @@ -400,10 +400,10 @@ func createReplicaSetOrFail(clientset *fedclientset.Clientset, replicaset *v1bet } By(fmt.Sprintf("Creating federation replicaset %q in namespace %q", replicaset.Name, namespace)) - _, err := clientset.Extensions().ReplicaSets(namespace).Create(replicaset) + newRS, err := clientset.Extensions().ReplicaSets(namespace).Create(replicaset) framework.ExpectNoError(err, "Creating replicaset %q in namespace %q", replicaset.Name, namespace) - By(fmt.Sprintf("Successfully created federation replicaset %q in namespace %q", replicaset.Name, namespace)) - return replicaset + By(fmt.Sprintf("Successfully created federation replicaset %q in namespace %q", newRS.Name, namespace)) + return newRS } func deleteReplicaSetOrFail(clientset *fedclientset.Clientset, nsName string, replicaSetName string, orphanDependents *bool) {