Merge pull request #3897 from u5surf/issue-3878

Replace server name in updateKubeConfig if --apiserver-name exists #3878
pull/3839/head^2
Thomas Strömberg 2019-03-21 11:33:54 -07:00 committed by GitHub
commit 20b9cfd0f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -458,6 +458,9 @@ func updateKubeConfig(h *host.Host, c *cfg.Config) *kubeconfig.KubeConfigSetup {
}
addr = strings.Replace(addr, "tcp://", "https://", -1)
addr = strings.Replace(addr, ":2376", ":"+strconv.Itoa(c.KubernetesConfig.NodePort), -1)
if c.KubernetesConfig.APIServerName != constants.APIServerName {
addr = strings.Replace(addr, c.KubernetesConfig.NodeIP, c.KubernetesConfig.APIServerName, -1)
}
kcs := &kubeconfig.KubeConfigSetup{
ClusterName: cfg.GetMachineName(),