From 8ce36a92fe7f373379ea686e10cd8ce7ff488d50 Mon Sep 17 00:00:00 2001 From: Russell Jones Date: Tue, 13 Nov 2018 16:48:09 -0800 Subject: [PATCH] Only update kubeconfig if the proxy supports Kubernetes. --- tool/tsh/tsh.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tool/tsh/tsh.go b/tool/tsh/tsh.go index 7649a290c81fc..335c181756f75 100644 --- a/tool/tsh/tsh.go +++ b/tool/tsh/tsh.go @@ -424,9 +424,11 @@ func onLogin(cf *CLIConf) { return } - // Update kubernetes config file. - if err := kubeclient.UpdateKubeconfig(tc); err != nil { - utils.FatalError(err) + // If the proxy is advertising that it supports Kubernetes, update kubeconfig. + if tc.KubeProxyAddr != "" { + if err := kubeclient.UpdateKubeconfig(tc); err != nil { + utils.FatalError(err) + } } // Regular login without -i flag.