mirror of
https://github.com/kubernetes/sample-controller.git
synced 2026-05-01 00:00:03 +08:00
Merge pull request #72138 from dims/switch-location-for-goautoneg
Switch location for goautoneg vendored code Kubernetes-commit: ef2a5b948b0d6c422873a823755ee7d12284dcc3
This commit is contained in:
+6
-1
@@ -150,7 +150,12 @@ func (config *DeferredLoadingClientConfig) Namespace() (string, bool, error) {
|
||||
|
||||
// if we got a default namespace, determine whether it was explicit or implicit
|
||||
if raw, err := mergedKubeConfig.RawConfig(); err == nil {
|
||||
if context := raw.Contexts[raw.CurrentContext]; context != nil && len(context.Namespace) > 0 {
|
||||
// determine the current context
|
||||
currentContext := raw.CurrentContext
|
||||
if config.overrides != nil && len(config.overrides.CurrentContext) > 0 {
|
||||
currentContext = config.overrides.CurrentContext
|
||||
}
|
||||
if context := raw.Contexts[currentContext]; context != nil && len(context.Namespace) > 0 {
|
||||
return ns, false, nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user