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

Method getContextName

tools/clientcmd/client_config.go:374–383  ·  view source on GitHub ↗

getContextName returns the default, or user-set context name, and a boolean that indicates whether the default context name has been overwritten by a user-set flag, or left as its default value

()

Source from the content-addressed store, hash-verified

372// getContextName returns the default, or user-set context name, and a boolean that indicates
373// whether the default context name has been overwritten by a user-set flag, or left as its default value
374func (config *DirectClientConfig) getContextName() (string, bool) {
375 if len(config.overrides.CurrentContext) != 0 {
376 return config.overrides.CurrentContext, true
377 }
378 if len(config.contextName) != 0 {
379 return config.contextName, false
380 }
381
382 return config.config.CurrentContext, false
383}
384
385// getAuthInfoName returns a string containing the current authinfo name for the current context,
386// and a boolean indicating whether the default authInfo name is overwritten by a user-set flag, or

Callers 1

getContextMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected