mirror of
https://github.com/rancher/rke.git
synced 2025-08-01 07:08:38 +00:00
Return empty config if bearer token is present
This commit is contained in:
parent
33b815dbb8
commit
6341dadc2f
@ -276,7 +276,7 @@ func getLocalConfigAddress(localConfigPath string) (string, error) {
|
||||
|
||||
func getLocalAdminConfigWithNewAddress(localConfigPath, cpAddress string, clusterName string) string {
|
||||
config, _ := clientcmd.BuildConfigFromFlags("", localConfigPath)
|
||||
if config == nil {
|
||||
if config == nil || config.BearerToken != "" {
|
||||
return ""
|
||||
}
|
||||
config.Host = fmt.Sprintf("https://%s:6443", cpAddress)
|
||||
|
Loading…
Reference in New Issue
Block a user