handle minikube status retruning error for no good reason

pull/4946/head
Medya Gh 2019-07-31 18:15:35 -07:00
parent b08a2d8f92
commit 5f16becbab
2 changed files with 3 additions and 3 deletions

View File

@ -56,8 +56,7 @@ func testGvisorRestart(t *testing.T) {
t.Fatalf("waiting for gvisor controller to be up: %v", err)
}
mk.RunCommand("stop", false)
mk.CheckStatus(state.Stopped.String())
mk.RunCommand("stop", true)
stdout, stderr, err := mk.Start()
if err != nil {
t.Fatalf("failed to start minikube (for profile %s) failed : %v \nstdout: %s \nstderr: %s", t.Name(), err, stdout, stderr)

View File

@ -287,10 +287,11 @@ func (m *MinikubeRunner) Status() (status string, stderr string, err error) {
cmd := fmt.Sprintf("status --format={{.Host}} %s", m.GlobalArgs)
s := func() error {
status, stderr, err = m.RunCommandRetriable(cmd)
status = strings.TrimRight(status, "\n")
return err
}
err = RetryX(s, 2*time.Minute)
if err != nil && status == state.None.String() {
if err != nil && (status == state.None.String() || status == state.Stopped.String()) {
err = nil // because https://github.com/kubernetes/minikube/issues/4932
}
return status, stderr, err