Skip to content

Commit

Permalink
Merge pull request #2364 from fstrudel/2205-get-kubeconfig-error
Browse files Browse the repository at this point in the history
Cli: add the cluster name to the error message
  • Loading branch information
k8s-ci-robot committed Jul 19, 2021
2 parents c7f1d20 + f40a458 commit 754da24
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/cluster/internal/kubeconfig/kubeconfig.go
Expand Up @@ -63,7 +63,7 @@ func Get(p providers.Provider, name string, external bool) (string, error) {
}

// ContextForCluster returns the context name for a kind cluster based on
// it's name. This key is used for all list entries of kind clusters
// its name. This key is used for all list entries of kind clusters
func ContextForCluster(kindClusterName string) string {
return kubeconfig.KINDClusterKey(kindClusterName)
}
Expand All @@ -80,7 +80,8 @@ func get(p providers.Provider, name string, external bool) (*kubeconfig.Config,
return nil, err
}
if len(nodes) < 1 {
return nil, errors.New("could not locate any control plane nodes")
return nil, errors.Errorf("could not locate any control plane nodes for cluster named '%s'. "+
"Use the --name option to select a different cluster", name)
}
node := nodes[0]

Expand Down

0 comments on commit 754da24

Please sign in to comment.