From c3fba065a9e97d48e616885f405e9ab15dbbfcee Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Wed, 25 Mar 2020 14:07:39 -0700 Subject: [PATCH 1/2] do not override hostname if extraConfig is specified --- pkg/minikube/bootstrapper/bsutil/kubelet.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/minikube/bootstrapper/bsutil/kubelet.go b/pkg/minikube/bootstrapper/bsutil/kubelet.go index c2180838a301..4068deac2186 100644 --- a/pkg/minikube/bootstrapper/bsutil/kubelet.go +++ b/pkg/minikube/bootstrapper/bsutil/kubelet.go @@ -62,7 +62,7 @@ func extraKubeletOpts(mc config.ClusterConfig, nc config.Node, r cruntime.Manage extraOpts["node-ip"] = cp.IP } nodeName := KubeNodeName(mc, nc) - if nodeName != "" { + if _, ok := extraOpts["hostname-override"]; !ok { extraOpts["hostname-override"] = nodeName } From 6417e85f5b1d78865372230fba6b21f2fac2ac8e Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Wed, 25 Mar 2020 14:40:40 -0700 Subject: [PATCH 2/2] fix ordering --- pkg/minikube/bootstrapper/bsutil/kubelet.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/minikube/bootstrapper/bsutil/kubelet.go b/pkg/minikube/bootstrapper/bsutil/kubelet.go index 4068deac2186..1ed22d17c6b9 100644 --- a/pkg/minikube/bootstrapper/bsutil/kubelet.go +++ b/pkg/minikube/bootstrapper/bsutil/kubelet.go @@ -61,8 +61,8 @@ func extraKubeletOpts(mc config.ClusterConfig, nc config.Node, r cruntime.Manage if _, ok := extraOpts["node-ip"]; !ok { extraOpts["node-ip"] = cp.IP } - nodeName := KubeNodeName(mc, nc) if _, ok := extraOpts["hostname-override"]; !ok { + nodeName := KubeNodeName(mc, nc) extraOpts["hostname-override"] = nodeName }