Destroying the plugin if kill wasn't successful

This commit is contained in:
Diptanu Choudhury 2016-03-18 11:53:25 -07:00
parent 3c7b83b393
commit abf8e50c29

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)