Merge pull request #7786 from afbjorklund/service-enable

Enable docker and kubelet units after adding them
pull/7793/head
Medya Ghazizadeh 2020-04-20 13:52:11 -07:00 committed by GitHub
commit 31f7f0f679
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -786,6 +786,9 @@ func startKubeletIfRequired(runner command.Runner, sm sysinit.Manager) error {
return errors.Wrap(err, "starting kubelet")
}
if err := sm.Enable("kubelet"); err != nil {
return err
}
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