fix skipping starting cri service with force systemd

pull/14197/head
Steven Powell 2022-05-19 13:35:12 -07:00
parent fffffaa47b
commit 4362818c0c
1 changed files with 1 additions and 8 deletions

View File

@ -121,7 +121,6 @@ func (r *Docker) Enable(disOthers, forceSystemd, inUserNamespace bool) error {
if inUserNamespace { if inUserNamespace {
return errors.New("inUserNamespace must not be true for docker") return errors.New("inUserNamespace must not be true for docker")
} }
containerdWasActive := r.Init.Active("containerd")
if disOthers { if disOthers {
if err := disableOthers(r, r.Runner); err != nil { if err := disableOthers(r, r.Runner); err != nil {
@ -145,15 +144,9 @@ func (r *Docker) Enable(disOthers, forceSystemd, inUserNamespace bool) error {
if err := r.forceSystemd(); err != nil { if err := r.forceSystemd(); err != nil {
return err return err
} }
return r.Init.Restart("docker")
} }
if containerdWasActive && !dockerBoundToContainerd(r.Runner) { if err := r.Init.Restart("docker"); err != nil {
// Make sure to use the internal containerd
return r.Init.Restart("docker")
}
if err := r.Init.Start("docker"); err != nil {
return err return err
} }