Merge pull request #9291 from priyawadhwa/improve-error

Add advice for the DRV_CP_ENDPOINT error
pull/9296/head
Medya Ghazizadeh 2020-09-21 19:59:03 -05:00 committed by GitHub
commit 8190e184c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -311,7 +311,7 @@ func setupKubeAdm(mAPI libmachine.API, cfg config.ClusterConfig, n config.Node,
func setupKubeconfig(h *host.Host, cc *config.ClusterConfig, n *config.Node, clusterName string) *kubeconfig.Settings {
addr, err := apiServerURL(*h, *cc, *n)
if err != nil {
exit.Error(reason.DrvCPEndpoint, "Failed to get API Server URL", err)
exit.Message(reason.DrvCPEndpoint, fmt.Sprintf("failed to get API Server URL: %v", err), out.V{"profileArg": fmt.Sprintf("--profile=%s", clusterName)})
}
if cc.KubernetesConfig.APIServerName != constants.APIServerName {

View File

@ -207,7 +207,13 @@ var (
ProviderNotFound = Kind{ID: "PROVIDER_NOT_FOUND", ExitCode: ExProviderNotFound}
ProviderUnavailable = Kind{ID: "PROVIDER_UNAVAILABLE", ExitCode: ExProviderNotFound, Style: style.Shrug}
DrvCPEndpoint = Kind{ID: "DRV_CP_ENDPOINT", ExitCode: ExDriverError}
DrvCPEndpoint = Kind{ID: "DRV_CP_ENDPOINT",
Advice: `Recreate the cluster by running:
minikube delete {{.profileArg}}
minikube start {{.profileArg}}`,
ExitCode: ExDriverError,
Style: style.Failure,
}
DrvPortForward = Kind{ID: "DRV_PORT_FORWARD", ExitCode: ExDriverError}
DrvUnsupportedMulti = Kind{ID: "DRV_UNSUPPORTED_MULTINODE", ExitCode: ExDriverConflict}
DrvUnsupportedOS = Kind{ID: "DRV_UNSUPPORTED_OS", ExitCode: ExDriverUnsupported}