diff --git a/cmd/cli/install.go b/cmd/cli/install.go index 1d33e8d145..6825befa28 100644 --- a/cmd/cli/install.go +++ b/cmd/cli/install.go @@ -121,12 +121,12 @@ func newInstallCmd(config *helm.Configuration, out io.Writer) *cobra.Command { RunE: func(_ *cobra.Command, args []string) error { kubeconfig, err := settings.RESTClientGetter().ToRESTConfig() if err != nil { - return errors.Errorf("Error fetching kubeconfig") + return errors.Errorf("Error fetching kubeconfig: %s", err) } clientset, err := kubernetes.NewForConfig(kubeconfig) if err != nil { - return errors.Errorf("Could not access Kubernetes cluster. Check kubeconfig, %s", err) + return errors.Errorf("Could not access Kubernetes cluster, check kubeconfig: %s", err) } inst.clientSet = clientset return inst.run(config) diff --git a/cmd/cli/mesh_list.go b/cmd/cli/mesh_list.go index 719e3e17fd..656686cade 100644 --- a/cmd/cli/mesh_list.go +++ b/cmd/cli/mesh_list.go @@ -37,11 +37,11 @@ func newMeshList(out io.Writer) *cobra.Command { RunE: func(_ *cobra.Command, args []string) error { config, err := settings.RESTClientGetter().ToRESTConfig() if err != nil { - return errors.Errorf("Error fetching kubeconfig") + return errors.Errorf("Error fetching kubeconfig: %s", err) } clientset, err := kubernetes.NewForConfig(config) if err != nil { - return errors.Errorf("Could not access Kubernetes cluster. Check kubeconfig") + return errors.Errorf("Could not access Kubernetes cluster, check kubeconfig: %s", err) } meshList.clientSet = clientset return meshList.run() diff --git a/cmd/cli/metrics_disable.go b/cmd/cli/metrics_disable.go index a08f018b9d..93e8aa74cd 100644 --- a/cmd/cli/metrics_disable.go +++ b/cmd/cli/metrics_disable.go @@ -39,12 +39,12 @@ func newMetricsDisable(out io.Writer) *cobra.Command { RunE: func(_ *cobra.Command, args []string) error { config, err := settings.RESTClientGetter().ToRESTConfig() if err != nil { - return errors.Errorf("Error fetching kubeconfig") + return errors.Errorf("Error fetching kubeconfig: %s", err) } clientset, err := kubernetes.NewForConfig(config) if err != nil { - return errors.Errorf("Could not access Kubernetes cluster. Check kubeconfig") + return errors.Errorf("Could not access Kubernetes cluster, check kubeconfig: %s", err) } disableCmd.clientSet = clientset return disableCmd.run() diff --git a/cmd/cli/metrics_enable.go b/cmd/cli/metrics_enable.go index ef86729226..3283709468 100644 --- a/cmd/cli/metrics_enable.go +++ b/cmd/cli/metrics_enable.go @@ -42,12 +42,12 @@ func newMetricsEnable(out io.Writer) *cobra.Command { RunE: func(_ *cobra.Command, args []string) error { config, err := settings.RESTClientGetter().ToRESTConfig() if err != nil { - return errors.Errorf("Error fetching kubeconfig") + return errors.Errorf("Error fetching kubeconfig: %s", err) } clientset, err := kubernetes.NewForConfig(config) if err != nil { - return errors.Errorf("Could not access Kubernetes cluster. Check kubeconfig") + return errors.Errorf("Could not access Kubernetes cluster, check kubeconfig: %s", err) } enableCmd.clientSet = clientset return enableCmd.run() diff --git a/cmd/cli/namespace_add.go b/cmd/cli/namespace_add.go index a722b8dd3c..b167213a37 100644 --- a/cmd/cli/namespace_add.go +++ b/cmd/cli/namespace_add.go @@ -51,12 +51,12 @@ func newNamespaceAdd(out io.Writer) *cobra.Command { namespaceAdd.namespaces = args config, err := settings.RESTClientGetter().ToRESTConfig() if err != nil { - return errors.Errorf("Error fetching kubeconfig") + return errors.Errorf("Error fetching kubeconfig: %s", err) } clientset, err := kubernetes.NewForConfig(config) if err != nil { - return errors.Errorf("Could not access Kubernetes cluster. Check kubeconfig") + return errors.Errorf("Could not access Kubernetes cluster, check kubeconfig: %s", err) } namespaceAdd.clientSet = clientset return namespaceAdd.run() diff --git a/cmd/cli/namespace_ignore.go b/cmd/cli/namespace_ignore.go index dce6449d5f..00365b238b 100644 --- a/cmd/cli/namespace_ignore.go +++ b/cmd/cli/namespace_ignore.go @@ -43,12 +43,12 @@ func newNamespaceIgnore(out io.Writer) *cobra.Command { ignoreCmd.namespaces = args config, err := settings.RESTClientGetter().ToRESTConfig() if err != nil { - return errors.Errorf("Error fetching kubeconfig") + return errors.Errorf("Error fetching kubeconfig: %s", err) } clientset, err := kubernetes.NewForConfig(config) if err != nil { - return errors.Errorf("Could not access Kubernetes cluster. Check kubeconfig") + return errors.Errorf("Could not access Kubernetes cluster, check kubeconfig: %s", err) } ignoreCmd.clientSet = clientset return ignoreCmd.run() diff --git a/cmd/cli/namespace_list.go b/cmd/cli/namespace_list.go index d6ef787cca..7877d12967 100644 --- a/cmd/cli/namespace_list.go +++ b/cmd/cli/namespace_list.go @@ -41,12 +41,12 @@ func newNamespaceList(out io.Writer) *cobra.Command { config, err := settings.RESTClientGetter().ToRESTConfig() if err != nil { - return errors.Errorf("Error fetching kubeconfig") + return errors.Errorf("Error fetching kubeconfig: %s", err) } clientset, err := kubernetes.NewForConfig(config) if err != nil { - return errors.Errorf("Could not access Kubernetes cluster. Check kubeconfig") + return errors.Errorf("Could not access Kubernetes cluster, check kubeconfig: %s", err) } namespaceList.clientSet = clientset return namespaceList.run() diff --git a/cmd/cli/namespace_remove.go b/cmd/cli/namespace_remove.go index d23317d407..1d064d6bc4 100644 --- a/cmd/cli/namespace_remove.go +++ b/cmd/cli/namespace_remove.go @@ -40,12 +40,12 @@ func newNamespaceRemove(out io.Writer) *cobra.Command { namespaceRemove.namespace = args[0] config, err := settings.RESTClientGetter().ToRESTConfig() if err != nil { - return errors.Errorf("Error fetching kubeconfig") + return errors.Errorf("Error fetching kubeconfig: %s", err) } clientset, err := kubernetes.NewForConfig(config) if err != nil { - return errors.Errorf("Could not access Kubernetes cluster. Check kubeconfig") + return errors.Errorf("Could not access Kubernetes cluster, check kubeconfig: %s", err) } namespaceRemove.clientSet = clientset return namespaceRemove.run() diff --git a/cmd/cli/proxy_configdump.go b/cmd/cli/proxy_configdump.go index a92b5a80dd..baff7435eb 100644 --- a/cmd/cli/proxy_configdump.go +++ b/cmd/cli/proxy_configdump.go @@ -52,13 +52,13 @@ func newProxyDumpConfig(config *action.Configuration, out io.Writer) *cobra.Comm dumpConfigCmd.pod = args[0] conf, err := config.RESTClientGetter.ToRESTConfig() if err != nil { - return errors.Errorf("Error fetching kubeconfig") + return errors.Errorf("Error fetching kubeconfig: %s", err) } dumpConfigCmd.config = conf clientset, err := kubernetes.NewForConfig(conf) if err != nil { - return errors.Errorf("Could not access Kubernetes cluster. Check kubeconfig") + return errors.Errorf("Could not access Kubernetes cluster, check kubeconfig: %s", err) } dumpConfigCmd.clientSet = clientset return dumpConfigCmd.run()