mirror of https://github.com/k3s-io/k3s
Fix MaxPods test to work with image puller
parent
431040afd8
commit
262239d7ec
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue