From 7f371d63741812723c38653342bb41f0d3d5669d Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Wed, 5 Feb 2020 10:57:04 -0800 Subject: [PATCH 1/2] Remove stability requirement to save 1s of startup time --- pkg/minikube/bootstrapper/bsutil/kverify/kverify.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/minikube/bootstrapper/bsutil/kverify/kverify.go b/pkg/minikube/bootstrapper/bsutil/kverify/kverify.go index de8f797ddb7d..b4f29c280bc9 100644 --- a/pkg/minikube/bootstrapper/bsutil/kverify/kverify.go +++ b/pkg/minikube/bootstrapper/bsutil/kverify/kverify.go @@ -91,11 +91,7 @@ func SystemPods(client *kubernetes.Clientset, start time.Time, timeout time.Dura } 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 - } - 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") From 2ba6c111bb8a2f242d3e3a731d3af2ff65835387 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Wed, 5 Feb 2020 12:55:24 -0800 Subject: [PATCH 2/2] Remove extra log statements --- .../bootstrapper/bsutil/kverify/kverify.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/pkg/minikube/bootstrapper/bsutil/kverify/kverify.go b/pkg/minikube/bootstrapper/bsutil/kverify/kverify.go index b4f29c280bc9..5b05f137947d 100644 --- a/pkg/minikube/bootstrapper/bsutil/kverify/kverify.go +++ b/pkg/minikube/bootstrapper/bsutil/kverify/kverify.go @@ -71,26 +71,20 @@ 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", len(pods.Items)) + if len(pods.Items) < 2 { + return false, nil } - - glog.Infof("%d kube-system pods found since %s", len(pods.Items), podStart) return true, nil } if err := wait.PollImmediate(kconst.APICallRetryInterval, kconst.DefaultControlPlaneTimeout, podList); err != nil {