Destroying the plugin if kill wasn't successful

This commit is contained in:
Diptanu Choudhury
2016-03-18 11:53:25 -07:00
parent 0f355e8f87
commit 3bb4849a2d

View File

@@ -759,9 +759,13 @@ func (h *DockerHandle) Kill() error {
// Container has already been removed.
if strings.Contains(err.Error(), NoSuchContainerError) {
h.logger.Printf("[DEBUG] driver.docker: attempted to stop non-existent container %s", h.containerID)
h.executor.Exit()
h.pluginClient.Kill()
return nil
}
h.logger.Printf("[ERR] driver.docker: failed to stop container %s: %v", h.containerID, err)
h.executor.Exit()
h.pluginClient.Kill()
return fmt.Errorf("Failed to stop container %s: %s", h.containerID, err)
}
h.logger.Printf("[INFO] driver.docker: stopped container %s", h.containerID)