Skip to content

Commit 20b9cfd

Browse files
authored
Merge pull request #3897 from u5surf/issue-3878
Replace server name in updateKubeConfig if --apiserver-name exists #3878
2 parents 6bf6290 + a34a9d3 commit 20b9cfd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: cmd/minikube/cmd/start.go

+3
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,9 @@ func updateKubeConfig(h *host.Host, c *cfg.Config) *kubeconfig.KubeConfigSetup {
458458
}
459459
addr = strings.Replace(addr, "tcp://", "https://", -1)
460460
addr = strings.Replace(addr, ":2376", ":"+strconv.Itoa(c.KubernetesConfig.NodePort), -1)
461+
if c.KubernetesConfig.APIServerName != constants.APIServerName {
462+
addr = strings.Replace(addr, c.KubernetesConfig.NodeIP, c.KubernetesConfig.APIServerName, -1)
463+
}
461464

462465
kcs := &kubeconfig.KubeConfigSetup{
463466
ClusterName: cfg.GetMachineName(),

0 commit comments

Comments
 (0)