Skip to content
Permalink
Browse files
Merge pull request #724 from waynr/kubeconfig-credentials-check-token…
…-is-still-valid

Remove cached exec credentials when saving a kubeconfig
  • Loading branch information
Verolop committed Jan 9, 2020
2 parents f48d367 + 5c172ce commit 332ad96ff91e27c3fa5128cdec97aa5b60b9f8c0
Showing with 6 additions and 0 deletions.
  1. +6 −0 commands/kubernetes.go
@@ -869,6 +869,12 @@ func (s *KubernetesCommandService) RunKubernetesKubeconfigSave(c *CmdConfig) err
return err
}

path := cachedExecCredentialPath(clusterID)
_, err = os.Stat(path)
if err == nil {
os.Remove(path)
}

return s.writeOrAddToKubeconfig(clusterID, remoteKubeconfig, setCurrentContext)
}

0 comments on commit 332ad96

Please sign in to comment.