mirror of
https://github.com/rancher/rke.git
synced 2025-08-31 14:36:32 +00:00
Return empty config if bearer token is present
This commit is contained in:
committed by
Alena Prokharchyk
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)
|
||||
|
Reference in New Issue
Block a user