未验证 提交 8190e184 编写于 作者: M Medya Ghazizadeh 提交者: GitHub

Merge pull request #9291 from priyawadhwa/improve-error

Add advice for the DRV_CP_ENDPOINT error
......@@ -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 {
......
......@@ -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}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册