@@ -76,8 +76,7 @@ func WaitForSystemPods(r cruntime.Manager, bs bootstrapper.Bootstrapper, cfg con
76
76
}
77
77
78
78
// ExpectAppsRunning returns whether or not all expected k8s-apps are running. (without waiting for them)
79
- func ExpectAppsRunning (cfg * config.ClusterConfig , cs * kubernetes.Clientset , expected []string ) error {
80
-
79
+ func ExpectAppsRunning (cs * kubernetes.Clientset , expected []string ) error {
81
80
found := map [string ]bool {}
82
81
83
82
pods , err := cs .CoreV1 ().Pods ("kube-system" ).List (context .Background (), meta.ListOptions {})
@@ -86,32 +85,12 @@ func ExpectAppsRunning(cfg *config.ClusterConfig, cs *kubernetes.Clientset, expe
86
85
}
87
86
klog .Infof ("%d kube-system pods found" , len (pods .Items ))
88
87
89
- for ! config .IsHA (* cfg ) && ! cfg .DisableOptimizations {
90
- // when --disable-optimization is not specified
91
- // for non-HA cluster
92
- // core dns deployment has been scaled to 1 pods, wait until there is only 1 pod
93
- corednsPods , err := cs .CoreV1 ().Pods ("kube-system" ).List (context .Background (), meta.ListOptions {
94
- LabelSelector : "k8s-app=kube-dns" ,
95
- })
96
- if err != nil {
97
- return err
98
- }
99
- if len (corednsPods .Items ) == 1 {
100
- break
101
- }
102
- }
103
-
104
88
for _ , pod := range pods .Items {
105
89
klog .Info (podStatusMsg (pod ))
106
90
107
91
if pod .Status .Phase != core .PodRunning {
108
92
continue
109
93
}
110
- for _ , cs := range pod .Status .ContainerStatuses {
111
- if ! cs .Ready {
112
- continue
113
- }
114
- }
115
94
116
95
for k , v := range pod .ObjectMeta .Labels {
117
96
if k == "component" || k == "k8s-app" {
@@ -133,12 +112,12 @@ func ExpectAppsRunning(cfg *config.ClusterConfig, cs *kubernetes.Clientset, expe
133
112
}
134
113
135
114
// WaitForAppsRunning waits for expected Apps To be running
136
- func WaitForAppsRunning (cfg * config. ClusterConfig , cs * kubernetes.Clientset , expected []string , timeout time.Duration ) error {
115
+ func WaitForAppsRunning (cs * kubernetes.Clientset , expected []string , timeout time.Duration ) error {
137
116
klog .Info ("waiting for k8s-apps to be running ..." )
138
117
start := time .Now ()
139
118
140
119
checkRunning := func () error {
141
- return ExpectAppsRunning (cfg , cs , expected )
120
+ return ExpectAppsRunning (cs , expected )
142
121
}
143
122
144
123
if err := retry .Local (checkRunning , timeout ); err != nil {
0 commit comments