make it impossible to enable the kubelet service

pull/8035/head
Priya Wadhwa 2020-05-08 12:37:28 -07:00
parent 0fa24990c9
commit f574852125
1 changed files with 4 additions and 0 deletions

View File

@ -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
}