diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-09-23 18:04:29 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@gmail.com> | 2018-10-02 12:05:22 -0400 |
commit | 2c7f97d5a782d35efc195baf7a7ca9016ca05409 (patch) | |
tree | 2fe809fca125f2b1f425ba4a23e23a7ed10dbbae /cmd/podman/run.go | |
parent | 89c5804fe0ca3ece7587adb5d5c974dbc494f721 (diff) | |
download | podman-2c7f97d5a782d35efc195baf7a7ca9016ca05409.tar.gz podman-2c7f97d5a782d35efc195baf7a7ca9016ca05409.tar.bz2 podman-2c7f97d5a782d35efc195baf7a7ca9016ca05409.zip |
Add ContainerStateExited and OCI delete() in cleanup()
To work better with Kata containers, we need to delete() from the
OCI runtime as a part of cleanup, to ensure resources aren't
retained longer than they need to be.
To enable this, we need to add a new state to containers,
ContainerStateExited. Containers transition from
ContainerStateStopped to ContainerStateExited via cleanupRuntime
which is invoked as part of cleanup(). A container in the Exited
state is identical to Stopped, except it has been removed from
the OCI runtime and thus will be handled differently when
initializing the container.
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Diffstat (limited to 'cmd/podman/run.go')
-rw-r--r-- | cmd/podman/run.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/podman/run.go b/cmd/podman/run.go index f9a96e4a6..fbad4237d 100644 --- a/cmd/podman/run.go +++ b/cmd/podman/run.go @@ -140,7 +140,7 @@ func runCmd(c *cli.Context) error { return runtime.RemoveContainer(ctx, ctr, true) } - if err := ctr.Cleanup(); err != nil { + if err := ctr.Cleanup(ctx); err != nil { // If the container has been removed already, no need to error on cleanup // Also, if it was restarted, don't error either if errors.Cause(err) == libpod.ErrNoSuchCtr || |