mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
Fix MaxPods test to work with image puller
This commit is contained in:
parent
431040afd8
commit
262239d7ec
@ -132,6 +132,14 @@ func waitForStableCluster(c *client.Client) int {
|
|||||||
|
|
||||||
allPods, err := c.Pods(api.NamespaceAll).List(api.ListOptions{})
|
allPods, err := c.Pods(api.NamespaceAll).List(api.ListOptions{})
|
||||||
framework.ExpectNoError(err)
|
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)
|
scheduledPods, currentlyNotScheduledPods := getPodsScheduled(allPods)
|
||||||
for len(currentlyNotScheduledPods) != 0 {
|
for len(currentlyNotScheduledPods) != 0 {
|
||||||
time.Sleep(2 * time.Second)
|
time.Sleep(2 * time.Second)
|
||||||
|
Loading…
Reference in New Issue
Block a user