From fd76e6a05eae0e26740da55dd52d6a0e1b34ecca Mon Sep 17 00:00:00 2001 From: Paul Morie Date: Wed, 12 Oct 2016 15:24:23 -0400 Subject: [PATCH] Make Framework.MatchContainerOutput able to use GenerateName --- test/e2e/framework/util.go | 8 ++++---- test/e2e/service_accounts.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index ea1891cbb8e..8f5c1cc7216 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -2145,15 +2145,15 @@ func (f *Framework) MatchContainerOutput( podClient := f.PodClient() ns := f.Namespace.Name - podClient.Create(pod) + createdPod := podClient.Create(pod) // Wait for client pod to complete. - if err := WaitForPodSuccessInNamespace(f.Client, pod.Name, ns); err != nil { + if err := WaitForPodSuccessInNamespace(f.Client, createdPod.Name, ns); err != nil { return fmt.Errorf("expected pod %q success: %v", pod.Name, err) } // Grab its logs. Get host first. - podStatus, err := podClient.Get(pod.Name) + podStatus, err := podClient.Get(createdPod.Name) if err != nil { return fmt.Errorf("failed to get pod status: %v", err) } @@ -2162,7 +2162,7 @@ func (f *Framework) MatchContainerOutput( podStatus.Spec.NodeName, podStatus.Name, containerName, err) // Sometimes the actual containers take a second to get started, try to get logs for 60s - logs, err := GetPodLogs(f.Client, ns, pod.Name, containerName) + logs, err := GetPodLogs(f.Client, ns, podStatus.Name, containerName) if err != nil { Logf("Failed to get logs from node %q pod %q container %q. %v", podStatus.Spec.NodeName, podStatus.Name, containerName, err) diff --git a/test/e2e/service_accounts.go b/test/e2e/service_accounts.go index 3d9708a08fc..5db596850bb 100644 --- a/test/e2e/service_accounts.go +++ b/test/e2e/service_accounts.go @@ -191,7 +191,7 @@ var _ = framework.KubeDescribe("ServiceAccounts", func() { pod := &api.Pod{ ObjectMeta: api.ObjectMeta{ - Name: "pod-service-account-" + string(uuid.NewUUID()), + GenerateName: "pod-service-account-" + string(uuid.NewUUID()) + "-", }, Spec: api.PodSpec{ Containers: []api.Container{