Need to set up docker group in start - not in fix

It was only called for existing machines, not for new.

But other commands expect to be able to run "docker".
pull/10099/head
Anders F Björklund 2020-10-29 12:18:49 +01:00
parent d96d3befbe
commit a0d2c1a0c5
2 changed files with 6 additions and 6 deletions

View File

@ -95,12 +95,6 @@ func fixHost(api libmachine.API, cc *config.ClusterConfig, n *config.Node) (*hos
return h, nil
}
if h.Driver.DriverName() == driver.Generic {
if _, err := h.RunSSHCommand(fmt.Sprintf("sudo usermod -aG docker %s", h.Driver.GetSSHUsername())); err != nil {
return h, errors.Wrap(err, "usermod")
}
}
return h, ensureSyncedGuestClock(h, driverName)
}

View File

@ -168,6 +168,12 @@ func createHost(api libmachine.API, cfg *config.ClusterConfig, n *config.Node) (
return h, errors.Wrap(err, "post-start")
}
if h.Driver.DriverName() == driver.Generic {
if _, err := h.RunSSHCommand(fmt.Sprintf("sudo usermod -aG docker %s", h.Driver.GetSSHUsername())); err != nil {
return h, errors.Wrap(err, "usermod")
}
}
if err := saveHost(api, h, cfg, n); err != nil {
return h, err
}