Enable docker and kubelet units after adding them

This avoids warnings from `kubeadm init` later:

[WARNING Service-Docker]
[WARNING Service-Kubelet]
pull/7786/head
Anders F Björklund 2020-04-19 17:27:23 +02:00
parent f66ebabd54
commit 49ebcc87d3
2 changed files with 2 additions and 1 deletions

View File

@ -786,6 +786,7 @@ func startKubeletIfRequired(runner command.Runner, sm sysinit.Manager) error {
return errors.Wrap(err, "starting kubelet")
}
sm.Enable("kubelet")
return sm.Start("kubelet")
}

View File

@ -292,7 +292,7 @@ func updateUnit(p provision.SSHCommander, name string, content string, dst strin
if _, err := p.SSHCommand(fmt.Sprintf("sudo mkdir -p %s && printf %%s \"%s\" | sudo tee %s.new", path.Dir(dst), content, dst)); err != nil {
return err
}
if _, err := p.SSHCommand(fmt.Sprintf("sudo diff -u %s %s.new || { sudo mv %s.new %s; sudo systemctl -f daemon-reload && sudo sudo systemctl -f restart %s; }", dst, dst, dst, dst, name)); err != nil {
if _, err := p.SSHCommand(fmt.Sprintf("sudo diff -u %s %s.new || { sudo mv %s.new %s; sudo systemctl -f daemon-reload && sudo systemctl -f enable %s && sudo systemctl -f restart %s; }", dst, dst, dst, dst, name, name)); err != nil {
return err
}
return nil