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

Cli: add the cluster name to the error message #2364

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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