diff --git a/pkg/minikube/bootstrapper/bsutil/kverify/api_server.go b/pkg/minikube/bootstrapper/bsutil/kverify/api_server.go index d98b069c7e6e..2fc1566bd144 100644 --- a/pkg/minikube/bootstrapper/bsutil/kverify/api_server.go +++ b/pkg/minikube/bootstrapper/bsutil/kverify/api_server.go @@ -205,7 +205,13 @@ func apiServerHealthz(hostname string, port int) (state.State, error) { return nil } - err = retry.Local(check, 8*time.Second) + err = retry.Local(check, 5*time.Second) + + // Don't propagate 'Stopped' upwards as an error message, as clients may interpret the err + // as an inability to get status. We need it for retry.Local, however. + if st == state.Stopped { + return st, nil + } return st, err } diff --git a/pkg/util/retry/retry.go b/pkg/util/retry/retry.go index 8bdacf461096..cc2b53457580 100644 --- a/pkg/util/retry/retry.go +++ b/pkg/util/retry/retry.go @@ -36,6 +36,7 @@ func Local(callback func() error, maxTime time.Duration) error { b.InitialInterval = 250 * time.Millisecond b.RandomizationFactor = 0.25 b.Multiplier = 1.25 + b.MaxElapsedTime = maxTime return backoff.RetryNotify(callback, b, notify) }