@@ -44,7 +44,7 @@ func SIGDescribe(text string, body func()) bool {
44
44
func WaitForStableCluster (c clientset.Interface , workerNodes sets.String ) int {
45
45
startTime := time .Now ()
46
46
// Wait for all pods to be scheduled.
47
- allScheduledPods , allNotScheduledPods := getScheduledAndUnscheduledPods (c , workerNodes , metav1 . NamespaceAll )
47
+ allScheduledPods , allNotScheduledPods := getScheduledAndUnscheduledPods (c , workerNodes )
48
48
for len (allNotScheduledPods ) != 0 {
49
49
time .Sleep (waitTime )
50
50
if startTime .Add (timeout ).Before (time .Now ()) {
@@ -55,7 +55,7 @@ func WaitForStableCluster(c clientset.Interface, workerNodes sets.String) int {
55
55
framework .Failf ("Timed out after %v waiting for stable cluster." , timeout )
56
56
break
57
57
}
58
- allScheduledPods , allNotScheduledPods = getScheduledAndUnscheduledPods (c , workerNodes , metav1 . NamespaceAll )
58
+ allScheduledPods , allNotScheduledPods = getScheduledAndUnscheduledPods (c , workerNodes )
59
59
}
60
60
return len (allScheduledPods )
61
61
}
@@ -78,10 +78,11 @@ func WaitForPodsToBeDeleted(c clientset.Interface) {
78
78
}
79
79
}
80
80
81
- // getScheduledAndUnscheduledPods lists scheduled and not scheduled pods in the given namespace, with succeeded and failed pods filtered out.
82
- func getScheduledAndUnscheduledPods (c clientset.Interface , workerNodes sets.String , ns string ) (scheduledPods , notScheduledPods []v1.Pod ) {
83
- pods , err := c .CoreV1 ().Pods (ns ).List (context .TODO (), metav1.ListOptions {})
84
- framework .ExpectNoError (err , fmt .Sprintf ("listing all pods in namespace %q while waiting for stable cluster" , ns ))
81
+ // getScheduledAndUnscheduledPods lists scheduled and not scheduled pods in all namespaces, with succeeded and failed pods filtered out.
82
+ func getScheduledAndUnscheduledPods (c clientset.Interface , workerNodes sets.String ) (scheduledPods , notScheduledPods []v1.Pod ) {
83
+ pods , err := c .CoreV1 ().Pods (metav1 .NamespaceAll ).List (context .TODO (), metav1.ListOptions {})
84
+ framework .ExpectNoError (err , fmt .Sprintf ("listing all pods in namespace %q while waiting for stable cluster" , metav1 .NamespaceAll ))
85
+
85
86
// API server returns also Pods that succeeded. We need to filter them out.
86
87
filteredPods := make ([]v1.Pod , 0 , len (pods .Items ))
87
88
for _ , p := range pods .Items {
0 commit comments