Skip to content

Commit

Permalink
Merge pull request #6509 from tstromberg/faster-health
Browse files Browse the repository at this point in the history
Remove pod list stability double check
  • Loading branch information
tstromberg authored Feb 5, 2020
2 parents 852d617 + 2ba6c11 commit 88c51d7
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions pkg/minikube/bootstrapper/bsutil/kverify/kverify.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,31 +71,21 @@ func apiServerPID(cr command.Runner) (int, error) {
func SystemPods(client *kubernetes.Clientset, start time.Time, timeout time.Duration) error {
glog.Info("waiting for kube-system pods to appear ...")
pStart := time.Now()
podStart := time.Time{}
podList := func() (bool, error) {
if time.Since(start) > timeout {
return false, fmt.Errorf("cluster wait timed out during pod check")
}
// Wait for any system pod, as waiting for apiserver may block until etcd
pods, err := client.CoreV1().Pods("kube-system").List(meta.ListOptions{})
if len(pods.Items) < 2 {
podStart = time.Time{}
return false, nil
}
if err != nil {
podStart = time.Time{}
glog.Warningf("pod list returned error: %v", err)
return false, nil
}
if podStart.IsZero() {
podStart = time.Now()
}

glog.Infof("%d kube-system pods found since %s", len(pods.Items), podStart)
if time.Since(podStart) > 2*kconst.APICallRetryInterval {
glog.Infof("stability requirement met, returning")
return true, nil
glog.Infof("%d kube-system pods found", len(pods.Items))
if len(pods.Items) < 2 {
return false, nil
}
return false, nil
return true, nil
}
if err := wait.PollImmediate(kconst.APICallRetryInterval, kconst.DefaultControlPlaneTimeout, podList); err != nil {
return fmt.Errorf("apiserver never returned a pod list")
Expand Down

0 comments on commit 88c51d7

Please sign in to comment.