Replace server name in updateKubeConfig if --apiserver-name exists #3878
parent
016e3f3178
commit
a34a9d32e6
|
@ -443,6 +443,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(),
|
||||
|
|
Loading…
Reference in New Issue