Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete context when stopped #9414

Merged
merged 3 commits into from
Oct 8, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add HostKubeconfigDeleteCtx Reason Exit
  • Loading branch information
prezha committed Oct 7, 2020
commit c63de60aba5682ae564289a1f5017e66ed82155f
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func stopProfile(profile string) int {

if !keepActive {
if err := kubeconfig.DeleteContext(profile, kubeconfig.PathFromEnv()); err != nil {
exit.Error(reason.HostKubeconfigUpdate, "update config", err)
exit.Error(reason.HostKubeconfigDeleteCtx, "delete ctx", err)
}
}

Expand Down
23 changes: 12 additions & 11 deletions pkg/minikube/reason/reason.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down