Merge pull request #42710 from madhusudancs/fed-e2e-rs-createdobj

Automatic merge from submit-queue

[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.

```release-note
NONE
```
pull/6/head
Kubernetes Submit Queue 2017-03-07 23:42:37 -08:00 committed by GitHub
commit a75718c912
1 changed files with 3 additions and 3 deletions

View File

@ -400,10 +400,10 @@ func createReplicaSetOrFail(clientset *fedclientset.Clientset, replicaset *v1bet
} }
By(fmt.Sprintf("Creating federation replicaset %q in namespace %q", replicaset.Name, namespace)) 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) 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)) By(fmt.Sprintf("Successfully created federation replicaset %q in namespace %q", newRS.Name, namespace))
return replicaset return newRS
} }
func deleteReplicaSetOrFail(clientset *fedclientset.Clientset, nsName string, replicaSetName string, orphanDependents *bool) { func deleteReplicaSetOrFail(clientset *fedclientset.Clientset, nsName string, replicaSetName string, orphanDependents *bool) {