MCPcopy
hub / github.com/kubernetes/client-go / getClusterName

Method getClusterName

tools/clientcmd/client_config.go:399–405  ·  view source on GitHub ↗

getClusterName returns a string containing the default, or user-set cluster name, and a boolean indicating whether the default clusterName has been overwritten by a user-set flag, or left as its default value

()

Source from the content-addressed store, hash-verified

397// indicating whether the default clusterName has been overwritten by a user-set flag, or left as
398// its default value
399func (config *DirectClientConfig) getClusterName() (string, bool) {
400 if len(config.overrides.Context.Cluster) != 0 {
401 return config.overrides.Context.Cluster, true
402 }
403 context, _ := config.getContext()
404 return context.Cluster, false
405}
406
407// getContext returns the clientcmdapi.Context, or an error if a required context is not found.
408func (config *DirectClientConfig) getContext() (clientcmdapi.Context, error) {

Callers 2

ConfirmUsableMethod · 0.95
getClusterMethod · 0.95

Calls 1

getContextMethod · 0.95

Tested by

no test coverage detected