mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
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.
This commit is contained in:
parent
d8d9c6c423
commit
73f2c55e0a
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user