From 21a475eefb852046f0a2ef316429cdbf427cde39 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Mon, 24 Apr 2017 11:49:10 -0400 Subject: [PATCH] Stop treating in-cluster-config namespace as an override Kubernetes-commit: 1305559abbcd1e5558980062221ed3e65a8f0387 --- tools/clientcmd/client_config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/clientcmd/client_config.go b/tools/clientcmd/client_config.go index 0411e623..307d1216 100644 --- a/tools/clientcmd/client_config.go +++ b/tools/clientcmd/client_config.go @@ -482,13 +482,13 @@ func (config *inClusterClientConfig) Namespace() (string, bool, error) { // This way assumes you've set the POD_NAMESPACE environment variable using the downward API. // This check has to be done first for backwards compatibility with the way InClusterConfig was originally set up if ns := os.Getenv("POD_NAMESPACE"); ns != "" { - return ns, true, nil + return ns, false, nil } // Fall back to the namespace associated with the service account token, if available if data, err := ioutil.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace"); err == nil { if ns := strings.TrimSpace(string(data)); len(ns) > 0 { - return ns, true, nil + return ns, false, nil } }