summaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-07-31 17:22:08 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-07-31 17:29:14 -0400
commit9dcd76e369fb163774f8f58a7da24a7899e95b60 (patch)
tree0275103226e0625c33a17b24ca5d24097a6e48aa /libpod/container_internal.go
parentef2d96a7a84f1ad7567d6e6ead9e46f9459a530b (diff)
downloadpodman-9dcd76e369fb163774f8f58a7da24a7899e95b60.tar.gz
podman-9dcd76e369fb163774f8f58a7da24a7899e95b60.tar.bz2
podman-9dcd76e369fb163774f8f58a7da24a7899e95b60.zip
Ensure we generate a 'stopped' event on force-remove
When forcibly removing a container, we are initiating an explicit stop of the container, which is not reflected in 'podman events'. Swap to using our standard 'stop()' function instead of a custom one for force-remove, and move the event into the internal stop function (so internal calls also register it). This does add one more database save() to `podman remove`. This should not be a terribly serious performance hit, and does have the desirable side effect of making things generally safer. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 3114e00c0..aba9c5b93 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -1108,7 +1108,13 @@ func (c *Container) stop(timeout uint) error {
}
// Wait until we have an exit file, and sync once we do
- return c.waitForExitFileAndSync()
+ if err := c.waitForExitFileAndSync(); err != nil {
+ return err
+ }
+
+ c.newContainerEvent(events.Stop)
+
+ return nil
}
// Internal, non-locking function to pause a container