diff --git a/pkg/minikube/out/register/json_test.go b/pkg/minikube/out/register/json_test.go index 40d7767701..f6035273fd 100644 --- a/pkg/minikube/out/register/json_test.go +++ b/pkg/minikube/out/register/json_test.go @@ -24,6 +24,8 @@ import ( ) func TestPrintStep(t *testing.T) { + Reg.SetStep(InitialSetup) + expected := `{"data":{"currentstep":"0","message":"message","name":"Initial Minikube Setup","totalsteps":"%v"},"datacontenttype":"application/json","id":"random-id","source":"https://minikube.sigs.k8s.io/","specversion":"1.0","type":"io.k8s.sigs.minikube.step"}` expected = fmt.Sprintf(expected, Reg.totalSteps()) expected += "\n" @@ -36,7 +38,6 @@ func TestPrintStep(t *testing.T) { return "random-id" } - Reg.SetStep(InitialSetup) PrintStep("message") actual := buf.String() diff --git a/pkg/minikube/out/register/register.go b/pkg/minikube/out/register/register.go index 301fa0944c..b13879433f 100644 --- a/pkg/minikube/out/register/register.go +++ b/pkg/minikube/out/register/register.go @@ -110,7 +110,8 @@ func (r *Register) currentStep() string { // all steps should be registered so this shouldn't happen // can't call exit.WithError as it creates an import dependency loop - panic(fmt.Sprintf("%q is in the expected steps for %q: %v", r.current, r.first, steps)) + glog.Errorf("%q was not found within the registered steps for %q: %v", r.current, r.first, steps) + return "" } // SetStep sets the current step