Commit e05ef872 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #35099 from gmarek/startpods

Automatic merge from submit-queue Fix StartPods Fix #34221
parents c900a0ed 959044ad
...@@ -565,14 +565,18 @@ func StartPods(c *client.Client, replicas int, namespace string, podNamePrefix s ...@@ -565,14 +565,18 @@ func StartPods(c *client.Client, replicas int, namespace string, podNamePrefix s
pod.ObjectMeta.Labels["startPodsID"] = startPodsID pod.ObjectMeta.Labels["startPodsID"] = startPodsID
pod.Spec.Containers[0].Name = podName pod.Spec.Containers[0].Name = podName
_, err := c.Pods(namespace).Create(&pod) _, err := c.Pods(namespace).Create(&pod)
if err != nil {
return err return err
} }
}
logFunc("Waiting for running...") logFunc("Waiting for running...")
if waitForRunning { if waitForRunning {
label := labels.SelectorFromSet(labels.Set(map[string]string{"startPodsID": startPodsID})) label := labels.SelectorFromSet(labels.Set(map[string]string{"startPodsID": startPodsID}))
err := WaitForPodsWithLabelRunning(c, namespace, label) err := WaitForPodsWithLabelRunning(c, namespace, label)
if err != nil {
return fmt.Errorf("Error waiting for %d pods to be running - probably a timeout: %v", replicas, err) return fmt.Errorf("Error waiting for %d pods to be running - probably a timeout: %v", replicas, err)
} }
}
return nil return nil
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment