diff --git a/cmd/minikube/cmd/stop.go b/cmd/minikube/cmd/stop.go index dc595cff918f..c5a52f4243ff 100644 --- a/cmd/minikube/cmd/stop.go +++ b/cmd/minikube/cmd/stop.go @@ -115,8 +115,8 @@ func stopProfile(profile string) int { } if !keepActive { - if err := kubeconfig.UnsetCurrentContext(profile, kubeconfig.PathFromEnv()); err != nil { - exit.Error(reason.HostKubeconfigUnset, "update config", err) + if err := kubeconfig.DeleteContext(profile, kubeconfig.PathFromEnv()); err != nil { + exit.Error(reason.HostKubeconfigDeleteCtx, "delete ctx", err) } } diff --git a/pkg/minikube/reason/reason.go b/pkg/minikube/reason/reason.go index 497f54cfa749..91df1b4787ae 100644 --- a/pkg/minikube/reason/reason.go +++ b/pkg/minikube/reason/reason.go @@ -199,17 +199,18 @@ var ( Issues: []int{9165}, } - HostCurrentUser = Kind{ID: "HOST_CURRENT_USER", ExitCode: ExHostConfig} - HostDelCache = Kind{ID: "HOST_DEL_CACHE", ExitCode: ExHostError} - HostKillMountProc = Kind{ID: "HOST_KILL_MOUNT_PROC", ExitCode: ExHostError} - HostKubeconfigUnset = Kind{ID: "HOST_KUBECNOFIG_UNSET", ExitCode: ExHostConfig} - HostKubeconfigUpdate = Kind{ID: "HOST_KUBECONFIG_UPDATE", ExitCode: ExHostConfig} - HostKubectlProxy = Kind{ID: "HOST_KUBECTL_PROXY", ExitCode: ExHostError} - HostMountPid = Kind{ID: "HOST_MOUNT_PID", ExitCode: ExHostError} - HostPathMissing = Kind{ID: "HOST_PATH_MISSING", ExitCode: ExHostNotFound} - HostPathStat = Kind{ID: "HOST_PATH_STAT", ExitCode: ExHostError} - HostPurge = Kind{ID: "HOST_PURGE", ExitCode: ExHostError} - HostSaveProfile = Kind{ID: "HOST_SAVE_PROFILE", ExitCode: ExHostConfig} + HostCurrentUser = Kind{ID: "HOST_CURRENT_USER", ExitCode: ExHostConfig} + HostDelCache = Kind{ID: "HOST_DEL_CACHE", ExitCode: ExHostError} + HostKillMountProc = Kind{ID: "HOST_KILL_MOUNT_PROC", ExitCode: ExHostError} + HostKubeconfigUnset = Kind{ID: "HOST_KUBECNOFIG_UNSET", ExitCode: ExHostConfig} + HostKubeconfigUpdate = Kind{ID: "HOST_KUBECONFIG_UPDATE", ExitCode: ExHostConfig} + HostKubeconfigDeleteCtx = Kind{ID: "HOST_KUBECONFIG_DELETE_CTX", ExitCode: ExHostConfig} + HostKubectlProxy = Kind{ID: "HOST_KUBECTL_PROXY", ExitCode: ExHostError} + HostMountPid = Kind{ID: "HOST_MOUNT_PID", ExitCode: ExHostError} + HostPathMissing = Kind{ID: "HOST_PATH_MISSING", ExitCode: ExHostNotFound} + HostPathStat = Kind{ID: "HOST_PATH_STAT", ExitCode: ExHostError} + HostPurge = Kind{ID: "HOST_PURGE", ExitCode: ExHostError} + HostSaveProfile = Kind{ID: "HOST_SAVE_PROFILE", ExitCode: ExHostConfig} ProviderNotFound = Kind{ID: "PROVIDER_NOT_FOUND", ExitCode: ExProviderNotFound} ProviderUnavailable = Kind{ID: "PROVIDER_UNAVAILABLE", ExitCode: ExProviderNotFound, Style: style.Shrug}