diff --git a/pkg/minikube/out/out.go b/pkg/minikube/out/out.go index 9886315402..55300e564e 100644 --- a/pkg/minikube/out/out.go +++ b/pkg/minikube/out/out.go @@ -69,6 +69,8 @@ var ( spin = spinner.New(spinner.CharSets[style.SpinnerCharacter], 100*time.Millisecond, spinner.WithWriter(outFile)) // defaultBoxCfg is the default style config for cli box output defaultBoxCfg = box.Config{Py: 1, Px: 4, Type: "Round", Color: "Red"} + // alreadyShoweddGitHubIssueMessage is used to prevent showing the GitHub issue message multiple times + alreadyShoweddGitHubIssueMessage = false ) // MaxLogEntries controls the number of log entries to show for each source @@ -477,6 +479,9 @@ func command() (string, error) { } func displayGitHubIssueMessage() { + if alreadyShoweddGitHubIssueMessage { + return + } cmd, err := command() if err != nil { klog.Warningf("failed to get command: %v", err) @@ -496,6 +501,7 @@ func displayGitHubIssueMessage() { } BoxedErr(msg) + alreadyShoweddGitHubIssueMessage = true } // applyTmpl applies formatting diff --git a/pkg/minikube/out/out_test.go b/pkg/minikube/out/out_test.go index 151d8b3f81..de1f9ab953 100644 --- a/pkg/minikube/out/out_test.go +++ b/pkg/minikube/out/out_test.go @@ -230,6 +230,7 @@ func TestDisplayGitHubIssueMessage(t *testing.T) { pflag.Parse() f := tests.NewFakeFile() SetErrFile(f) + alreadyShoweddGitHubIssueMessage = false // Reset the flag for each test case displayGitHubIssueMessage() output := f.String() if strings.Contains(output, msg) && !tt.shouldContainMessage {