提交 e437e1c4 编写于 作者: T Thomas Stromberg

Use -f to remove up to 6s of of delay disabling containerd.

上级 8d1f4552
...@@ -217,7 +217,7 @@ func (r *Containerd) Enable(disOthers bool) error { ...@@ -217,7 +217,7 @@ func (r *Containerd) Enable(disOthers bool) error {
// Disable idempotently disables containerd on a host // Disable idempotently disables containerd on a host
func (r *Containerd) Disable() error { func (r *Containerd) Disable() error {
c := exec.Command("sudo", "systemctl", "stop", "containerd") c := exec.Command("sudo", "systemctl", "stop", "-f", "containerd")
if _, err := r.Runner.RunCmd(c); err != nil { if _, err := r.Runner.RunCmd(c); err != nil {
return errors.Wrapf(err, "stop containerd") return errors.Wrapf(err, "stop containerd")
} }
......
...@@ -133,7 +133,7 @@ func (r *CRIO) Enable(disOthers bool) error { ...@@ -133,7 +133,7 @@ func (r *CRIO) Enable(disOthers bool) error {
// Disable idempotently disables CRIO on a host // Disable idempotently disables CRIO on a host
func (r *CRIO) Disable() error { func (r *CRIO) Disable() error {
if _, err := r.Runner.RunCmd(exec.Command("sudo", "systemctl", "stop", "crio")); err != nil { if _, err := r.Runner.RunCmd(exec.Command("sudo", "systemctl", "stop", "-f", "crio")); err != nil {
return errors.Wrapf(err, "disable crio.") return errors.Wrapf(err, "disable crio.")
} }
return nil return nil
......
...@@ -127,7 +127,7 @@ func (r *Docker) Restart() error { ...@@ -127,7 +127,7 @@ func (r *Docker) Restart() error {
// Disable idempotently disables Docker on a host // Disable idempotently disables Docker on a host
func (r *Docker) Disable() error { func (r *Docker) Disable() error {
c := exec.Command("sudo", "systemctl", "stop", "docker", "docker.socket") c := exec.Command("sudo", "systemctl", "stop", "-f", "docker", "docker.socket")
if _, err := r.Runner.RunCmd(c); err != nil { if _, err := r.Runner.RunCmd(c); err != nil {
return errors.Wrap(err, "disable docker") return errors.Wrap(err, "disable docker")
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册