fix: empty server host

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2020-07-14 14:00:38 +08:00
parent 78159e9636
commit 311c5289aa

View File

@@ -181,7 +181,7 @@ func (o *operator) GetKubeConfig(username string) (string, error) {
masterURL := o.masterURL
// server host override
if cluster := kubeconfig.Clusters[defaultClusterName]; cluster != nil {
if cluster := kubeconfig.Clusters[defaultClusterName]; cluster != nil && masterURL != "" {
cluster.Server = masterURL
}