diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-04-03 14:17:02 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-05-03 10:36:16 -0400 |
commit | cafb68e301ca808392aa31fda51370593fcabbed (patch) | |
tree | 9fd50dd31134685fb471c8acc4a86c89d9cac3ff /libpod/container_internal.go | |
parent | 56356d70276bed453bfe67fee068a14b7c727b2f (diff) | |
download | podman-cafb68e301ca808392aa31fda51370593fcabbed.tar.gz podman-cafb68e301ca808392aa31fda51370593fcabbed.tar.bz2 podman-cafb68e301ca808392aa31fda51370593fcabbed.zip |
Add a restart event, and make one during restart policy
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r-- | libpod/container_internal.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 22ed34987..00f916d0f 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -229,6 +229,8 @@ func (c *Container) handleRestartPolicy(ctx context.Context) (err error) { return errors.Wrapf(ErrInternal, "invalid container state encountered in restart attempt!") } + c.newContainerEvent(events.Restart) + // Increment restart count c.state.RestartCount = c.state.RestartCount + 1 logrus.Debugf("Container %s now on retry %d", c.ID(), c.state.RestartCount) @@ -1060,6 +1062,8 @@ func (c *Container) restartWithTimeout(ctx context.Context, timeout uint) (err e return errors.Wrapf(ErrCtrStateInvalid, "unable to restart a container in a paused or unknown state") } + c.newContainerEvent(events.Restart) + if c.state.State == ContainerStateRunning { if err := c.stop(timeout); err != nil { return err |