Skip to content

Commit a44d027

Browse files
committed
Merge pull request kubernetes#26695 from gmarek/maxpods
Fix MaxPods test to work with image puller
2 parents 0ba4d88 + 262239d commit a44d027

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: test/e2e/scheduler_predicates.go

+8
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,14 @@ func waitForStableCluster(c *client.Client) int {
132132

133133
allPods, err := c.Pods(api.NamespaceAll).List(api.ListOptions{})
134134
framework.ExpectNoError(err)
135+
// API server returns also Pods that succeeded. We need to filter them out.
136+
currentPods := make([]api.Pod, 0, len(allPods.Items))
137+
for _, pod := range allPods.Items {
138+
if pod.Status.Phase != api.PodSucceeded && pod.Status.Phase != api.PodFailed {
139+
currentPods = append(currentPods, pod)
140+
}
141+
}
142+
allPods.Items = currentPods
135143
scheduledPods, currentlyNotScheduledPods := getPodsScheduled(allPods)
136144
for len(currentlyNotScheduledPods) != 0 {
137145
time.Sleep(2 * time.Second)

0 commit comments

Comments
 (0)