I'm trying to access the current cluster name by getting the current context name. So I wanted to know how to get the current context name using client provided by: "sigs.k8s.io/controller-runtime/pkg/client"
CodePudding user response:
The cluster name output by the kubectl cluster-info
command is only stored in the local kubeconfig file, it is not part of an API. So, you can not get the cluster name by using the client.