e2e.framework.util.StartPods:

The number of pods to start must be non-zero.
Otherwise the function waits for pods forever if waitForRunning is true.
It the number of replicas is zero, panic so the mistake is heard all over the e2e realm.

Update all callers of StartPods to test for non-zero number of replicas.
This commit is contained in:
Jan Chaloupka
2016-05-06 11:58:35 +02:00
parent 970104df31
commit d9f3e3c3ad
3 changed files with 56 additions and 41 deletions

View File

@@ -2471,12 +2471,12 @@ func (config *RCConfig) start() error {
}
// Simplified version of RunRC, that does not create RC, but creates plain Pods.
// optionally waits for pods to start running (if waitForRunning == true)
// Optionally waits for pods to start running (if waitForRunning == true).
// The number of replicas must be non-zero.
func StartPods(c *client.Client, replicas int, namespace string, podNamePrefix string, pod api.Pod, waitForRunning bool) {
// no pod to start
if replicas < 1 {
Logf("No pod to start, skipping...")
return
panic("StartPods: number of replicas must be non-zero")
}
startPodsID := string(util.NewUUID()) // So that we can label and find them
for i := 0; i < replicas; i++ {