diff --git a/pkg/cluster/internal/kubeconfig/kubeconfig.go b/pkg/cluster/internal/kubeconfig/kubeconfig.go index 4f022b8f30..0e552a8a58 100644 --- a/pkg/cluster/internal/kubeconfig/kubeconfig.go +++ b/pkg/cluster/internal/kubeconfig/kubeconfig.go @@ -20,7 +20,6 @@ package kubeconfig import ( "bytes" - "sigs.k8s.io/kind/pkg/cluster/nodeutils" "sigs.k8s.io/kind/pkg/errors" @@ -63,7 +62,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) } @@ -80,7 +79,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]