Make Framework.MatchContainerOutput able to use GenerateName

This commit is contained in:
Paul Morie 2016-10-12 15:24:23 -04:00
parent 53ec6e60fe
commit fd76e6a05e
2 changed files with 5 additions and 5 deletions

View File

@ -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)

View File

@ -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{