From ea221cfe879140e0f8187d22bd59a64a337209d4 Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Fri, 15 Nov 2019 09:33:46 -0500 Subject: [PATCH] always destroy --- drivers/exec/driver.go | 6 ++---- drivers/java/driver.go | 6 ++---- drivers/qemu/driver.go | 6 ++---- drivers/rawexec/driver.go | 6 ++---- drivers/rkt/driver.go | 6 ++---- 5 files changed, 10 insertions(+), 20 deletions(-) diff --git a/drivers/exec/driver.go b/drivers/exec/driver.go index 87974ce06..6611ec472 100644 --- a/drivers/exec/driver.go +++ b/drivers/exec/driver.go @@ -458,10 +458,8 @@ func (d *Driver) DestroyTask(taskID string, force bool) error { } if !handle.pluginClient.Exited() { - if handle.IsRunning() { - if err := handle.exec.Shutdown("", 0); err != nil { - handle.logger.Error("destroying executor failed", "err", err) - } + if err := handle.exec.Shutdown("", 0); err != nil { + handle.logger.Error("destroying executor failed", "err", err) } handle.pluginClient.Kill() diff --git a/drivers/java/driver.go b/drivers/java/driver.go index 4d10f0e66..ac35aa82d 100644 --- a/drivers/java/driver.go +++ b/drivers/java/driver.go @@ -486,10 +486,8 @@ func (d *Driver) DestroyTask(taskID string, force bool) error { } if !handle.pluginClient.Exited() { - if handle.IsRunning() { - if err := handle.exec.Shutdown("", 0); err != nil { - handle.logger.Error("destroying executor failed", "err", err) - } + if err := handle.exec.Shutdown("", 0); err != nil { + handle.logger.Error("destroying executor failed", "err", err) } handle.pluginClient.Kill() diff --git a/drivers/qemu/driver.go b/drivers/qemu/driver.go index 8cbe7d9f8..156dd1104 100644 --- a/drivers/qemu/driver.go +++ b/drivers/qemu/driver.go @@ -534,10 +534,8 @@ func (d *Driver) DestroyTask(taskID string, force bool) error { } if !handle.pluginClient.Exited() { - if handle.IsRunning() { - if err := handle.exec.Shutdown("", 0); err != nil { - handle.logger.Error("destroying executor failed", "err", err) - } + if err := handle.exec.Shutdown("", 0); err != nil { + handle.logger.Error("destroying executor failed", "err", err) } handle.pluginClient.Kill() diff --git a/drivers/rawexec/driver.go b/drivers/rawexec/driver.go index a69932bb5..9e754c5b3 100644 --- a/drivers/rawexec/driver.go +++ b/drivers/rawexec/driver.go @@ -460,10 +460,8 @@ func (d *Driver) DestroyTask(taskID string, force bool) error { } if !handle.pluginClient.Exited() { - if handle.IsRunning() { - if err := handle.exec.Shutdown("", 0); err != nil { - handle.logger.Error("destroying executor failed", "err", err) - } + if err := handle.exec.Shutdown("", 0); err != nil { + handle.logger.Error("destroying executor failed", "err", err) } handle.pluginClient.Kill() diff --git a/drivers/rkt/driver.go b/drivers/rkt/driver.go index b41455238..238dcfc77 100644 --- a/drivers/rkt/driver.go +++ b/drivers/rkt/driver.go @@ -810,10 +810,8 @@ func (d *Driver) DestroyTask(taskID string, force bool) error { } if !handle.pluginClient.Exited() { - if handle.IsRunning() { - if err := handle.exec.Shutdown("", 0); err != nil { - handle.logger.Error("destroying executor failed", "err", err) - } + if err := handle.exec.Shutdown("", 0); err != nil { + handle.logger.Error("destroying executor failed", "err", err) } handle.pluginClient.Kill()