From f574852125c79d0dc8e92669e044c26ac42a5bd5 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Fri, 8 May 2020 12:37:28 -0700 Subject: [PATCH] make it impossible to enable the kubelet service --- pkg/minikube/sysinit/systemd.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/minikube/sysinit/systemd.go b/pkg/minikube/sysinit/systemd.go index 4bb53a186b..9c6ad84b1c 100644 --- a/pkg/minikube/sysinit/systemd.go +++ b/pkg/minikube/sysinit/systemd.go @@ -18,6 +18,7 @@ limitations under the License. package sysinit import ( + "errors" "os/exec" "k8s.io/minikube/pkg/minikube/assets" @@ -53,6 +54,9 @@ func (s *Systemd) Disable(svc string) error { // Enable enables a service func (s *Systemd) Enable(svc string) error { + if svc == "kubelet" { + return errors.New("please don't enable kubelet as it creates a race condition; if it starts on systemd boot it will pick up /etc/hosts before we have time to configure /etc/hosts") + } _, err := s.r.RunCmd(exec.Command("sudo", "systemctl", "enable", svc)) return err }