mirror of
https://github.com/containers/podman.git
synced 2025-08-06 03:19:52 +08:00
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>
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user