From 6d8804e10ec61473344891e47a79db0d87100be0 Mon Sep 17 00:00:00 2001 From: hetong07 Date: Wed, 3 Feb 2021 18:21:10 -0800 Subject: [PATCH] Use the 'ExProgramUnsupported' as the error code for MK_WRONG_BINARY_WSL error. --- cmd/minikube/cmd/root.go | 2 +- pkg/minikube/reason/reason.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/minikube/cmd/root.go b/cmd/minikube/cmd/root.go index 5dff944808..b01d226592 100644 --- a/cmd/minikube/cmd/root.go +++ b/cmd/minikube/cmd/root.go @@ -108,7 +108,7 @@ func Execute() { } } if !found { - 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" + 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 18f7ffd2b6..bb033bd405 100644 --- a/pkg/minikube/reason/reason.go +++ b/pkg/minikube/reason/reason.go @@ -75,6 +75,8 @@ var ( Usage = Kind{ID: "MK_USAGE", ExitCode: ExProgramUsage} Interrupted = Kind{ID: "MK_INTERRUPTED", ExitCode: ExProgramConflict} + WrongBinaryWSL = Kind{ID: "MK_WRONG_BINARY_WSL", ExitCode: ExProgramUnsupported} + NewAPIClient = Kind{ID: "MK_NEW_APICLIENT", ExitCode: ExProgramError} InternalAddonEnable = Kind{ID: "MK_ADDON_ENABLE", ExitCode: ExProgramError} InternalAddConfig = Kind{ID: "MK_ADD_CONFIG", ExitCode: ExProgramError} @@ -190,7 +192,6 @@ var ( RsrcInsufficientStorage = Kind{ID: "RSRC_INSUFFICIENT_STORAGE", ExitCode: ExInsufficientStorage, Style: style.UnmetRequirement} - 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}