summaryrefslogtreecommitdiff
path: root/libpod/container_api.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-04-01 18:17:16 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-05-03 10:36:16 -0400
commitdc42304f3804632d01345478ab9b1f122b48d516 (patch)
treed63d4dc4738ab48f8f0ba81674303b9c94147d6f /libpod/container_api.go
parent0d73ee40b2e95ec7d50c7ee72fcb24cae0e190a7 (diff)
downloadpodman-dc42304f3804632d01345478ab9b1f122b48d516.tar.gz
podman-dc42304f3804632d01345478ab9b1f122b48d516.tar.bz2
podman-dc42304f3804632d01345478ab9b1f122b48d516.zip
Sending signals to containers prevents restart policy
Noticed this when testing some behavior with Docker. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r--libpod/container_api.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index 46c913e99..8b3dd4186 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -199,8 +199,15 @@ func (c *Container) Kill(signal uint) error {
if c.state.State != ContainerStateRunning {
return errors.Wrapf(ErrCtrStateInvalid, "can only kill running containers")
}
+
defer c.newContainerEvent(events.Kill)
- return c.runtime.ociRuntime.killContainer(c, signal)
+ if err := c.runtime.ociRuntime.killContainer(c, signal); err != nil {
+ return err
+ }
+
+ c.state.StoppedByUser = true
+
+ return c.save()
}
// Exec starts a new process inside the container