Fix MaxPods test to work with image puller

pull/6/head
gmarek 2016-06-02 12:05:20 +02:00
parent 431040afd8
commit 262239d7ec
1 changed files with 8 additions and 0 deletions

View File

@ -132,6 +132,14 @@ func waitForStableCluster(c *client.Client) int {
allPods, err := c.Pods(api.NamespaceAll).List(api.ListOptions{})
framework.ExpectNoError(err)
// API server returns also Pods that succeeded. We need to filter them out.
currentPods := make([]api.Pod, 0, len(allPods.Items))
for _, pod := range allPods.Items {
if pod.Status.Phase != api.PodSucceeded && pod.Status.Phase != api.PodFailed {
currentPods = append(currentPods, pod)
}
}
allPods.Items = currentPods
scheduledPods, currentlyNotScheduledPods := getPodsScheduled(allPods)
for len(currentlyNotScheduledPods) != 0 {
time.Sleep(2 * time.Second)