Merge branch 'master' into generic

pull/10099/head
Anders F Björklund 2021-01-09 14:11:09 +01:00
commit e53f537b39
1 changed files with 5 additions and 12 deletions

View File

@ -42,7 +42,7 @@ var cleanupPaths = []string{
vmpath.GuestPersistentDir, vmpath.GuestPersistentDir,
} }
// Driver is a driver designed to run kubeadm w/o VM management, and assumes systemctl. // Driver is a driver designed to run kubeadm w/o VM management.
// https://minikube.sigs.k8s.io/docs/reference/drivers/none/ // https://minikube.sigs.k8s.io/docs/reference/drivers/none/
type Driver struct { type Driver struct {
*drivers.BaseDriver *drivers.BaseDriver
@ -192,7 +192,10 @@ func (d *Driver) Remove() error {
// Restart a host // Restart a host
func (d *Driver) Restart() error { func (d *Driver) Restart() error {
return restartKubelet(d.exec) if err := sysinit.New(d.exec).Restart("kubelet"); err != nil {
return err
}
return nil
} }
// Start a host // Start a host
@ -234,13 +237,3 @@ func (d *Driver) Stop() error {
func (d *Driver) RunSSHCommandFromDriver() error { func (d *Driver) RunSSHCommandFromDriver() error {
return fmt.Errorf("driver does not support ssh commands") return fmt.Errorf("driver does not support ssh commands")
} }
// restartKubelet restarts the kubelet
func restartKubelet(cr command.Runner) error {
klog.Infof("restarting kubelet.service ...")
c := exec.Command("sudo", "systemctl", "restart", "kubelet.service")
if _, err := cr.RunCmd(c); err != nil {
return err
}
return nil
}