From 73f2c55e0a3cce7e659bb24996280ad9d59c4e9d Mon Sep 17 00:00:00 2001 From: Michael Taufen Date: Fri, 5 Aug 2016 15:02:44 -0700 Subject: [PATCH] Bug fix: Use p.Name instead of pod.Name For example, if you used pod.GenerateName, pod.Name might be the empty string while p.Name contains the actual name of your pod. Thus passing pod.Name can result in a `resource name may not be empty` error. --- test/e2e/framework/pods.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/framework/pods.go b/test/e2e/framework/pods.go index 20771003bcd..b82807825c7 100644 --- a/test/e2e/framework/pods.go +++ b/test/e2e/framework/pods.go @@ -56,7 +56,7 @@ func (c *PodClient) CreateSync(pod *api.Pod) *api.Pod { p := c.Create(pod) ExpectNoError(c.f.WaitForPodRunning(p.Name)) // Get the newest pod after it becomes running, some status may change after pod created, such as pod ip. - p, err := c.Get(pod.Name) + p, err := c.Get(p.Name) ExpectNoError(err) return p }