Merge pull request #35099 from gmarek/startpods

Automatic merge from submit-queue

Fix StartPods

Fix #34221
This commit is contained in:
Kubernetes Submit Queue 2016-10-19 03:09:51 -07:00 committed by GitHub
commit e05ef8724f

View File

@ -565,13 +565,17 @@ 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)
return err if err != nil {
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)
return fmt.Errorf("Error waiting for %d pods to be running - probably a timeout: %v", replicas, err) if err != nil {
return fmt.Errorf("Error waiting for %d pods to be running - probably a timeout: %v", replicas, err)
}
} }
return nil return nil
} }