Skip to content

Commit

Permalink
Rephrase the adivce, use the runtime.GOOS to check whether it is .exe…
Browse files Browse the repository at this point in the history
… binary and modify the error name to address comments in pull request.
  • Loading branch information
hetong07 committed Feb 4, 2021
1 parent 289bf2f commit 6549b95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/minikube/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func Execute() {
} else {
os.Args = append([]string{RootCmd.Use, callingCmd, "--"}, os.Args[1:]...)
}
} else if runtime.GOOS == "windows" && driver.IsMicrosoftWSL() {
} else if runtime.GOOS == "windows" && driver.IsMicrosoftWSL() && !viper.GetBool(force) {
var found = false
for _, a := range os.Args {
if a == "--force" {
Expand All @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/reason/reason.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 6549b95

Please sign in to comment.