From 547f506701fd0a0fba8dbebc2ed6fe0fd919642c Mon Sep 17 00:00:00 2001 From: hetong07 Date: Wed, 3 Feb 2021 18:01:30 -0800 Subject: [PATCH] Rephrase the adivce, use the runtime.GOOS to check whether it is .exe binary and modify the error name to address comments in pull request. --- cmd/minikube/cmd/root.go | 2 +- pkg/minikube/reason/reason.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/minikube/cmd/root.go b/cmd/minikube/cmd/root.go index dce3116cc7..5dff944808 100644 --- a/cmd/minikube/cmd/root.go +++ b/cmd/minikube/cmd/root.go @@ -108,7 +108,7 @@ func Execute() { } } if !found { - exit.Message(reason.WrongBinary, "Cannot run Windows binary inside WSL, please download linux binary from https://minikube.sigs.k8s.io/docs/start/. Or you can use '--force' to force execution which would be at your own risk.") + exit.Message(reason.WrongBinaryWSL, "You are trying to run windows .exe binary inside WSL, for better integration please use Linux binary instead (Download at https://minikube.sigs.k8s.io/docs/start/.). Otherwise if you still want to do this, you can do it using --force" } } for _, c := range RootCmd.Commands() { diff --git a/pkg/minikube/reason/reason.go b/pkg/minikube/reason/reason.go index f9ccbdf7e7..18f7ffd2b6 100644 --- a/pkg/minikube/reason/reason.go +++ b/pkg/minikube/reason/reason.go @@ -190,7 +190,7 @@ var ( RsrcInsufficientStorage = Kind{ID: "RSRC_INSUFFICIENT_STORAGE", ExitCode: ExInsufficientStorage, Style: style.UnmetRequirement} - WrongBinary = Kind{ID: "WRONG_BINARY", ExitCode: ExHostError} + WrongBinaryWSL = Kind{ID: "WRONG_BINARY_WSL", ExitCode: ExHostError} HostHomeMkdir = Kind{ID: "HOST_HOME_MKDIR", ExitCode: ExHostPermission} HostHomeChown = Kind{ID: "HOST_HOME_CHOWN", ExitCode: ExHostPermission} HostBrowser = Kind{ID: "HOST_BROWSER", ExitCode: ExHostError}