Skip to content

Commit 3018f83

Browse files
prezhamedyagh
authored andcommitted
Revert "fix --wait's failure to work on coredns pods (#19748)"
This reverts commit 3fef3ea.
1 parent de79a33 commit 3018f83

File tree

2 files changed

+4
-25
lines changed

2 files changed

+4
-25
lines changed

pkg/minikube/bootstrapper/bsutil/kverify/system_pods.go

+3-24
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ func WaitForSystemPods(r cruntime.Manager, bs bootstrapper.Bootstrapper, cfg con
7676
}
7777

7878
// 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 {
8180
found := map[string]bool{}
8281

8382
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
8685
}
8786
klog.Infof("%d kube-system pods found", len(pods.Items))
8887

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-
10488
for _, pod := range pods.Items {
10589
klog.Info(podStatusMsg(pod))
10690

10791
if pod.Status.Phase != core.PodRunning {
10892
continue
10993
}
110-
for _, cs := range pod.Status.ContainerStatuses {
111-
if !cs.Ready {
112-
continue
113-
}
114-
}
11594

11695
for k, v := range pod.ObjectMeta.Labels {
11796
if k == "component" || k == "k8s-app" {
@@ -133,12 +112,12 @@ func ExpectAppsRunning(cfg *config.ClusterConfig, cs *kubernetes.Clientset, expe
133112
}
134113

135114
// 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 {
137116
klog.Info("waiting for k8s-apps to be running ...")
138117
start := time.Now()
139118

140119
checkRunning := func() error {
141-
return ExpectAppsRunning(cfg, cs, expected)
120+
return ExpectAppsRunning(cs, expected)
142121
}
143122

144123
if err := retry.Local(checkRunning, timeout); err != nil {

pkg/minikube/bootstrapper/kubeadm/kubeadm.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ func (k *Bootstrapper) WaitForNode(cfg config.ClusterConfig, n config.Node, time
567567
}
568568

569569
if cfg.VerifyComponents[kverify.AppsRunningKey] {
570-
if err := kverify.WaitForAppsRunning(&cfg, client, kverify.AppsRunningList, timeout); err != nil {
570+
if err := kverify.WaitForAppsRunning(client, kverify.AppsRunningList, timeout); err != nil {
571571
return errors.Wrap(err, "waiting for apps_running")
572572
}
573573
}

0 commit comments

Comments
 (0)