summaryrefslogtreecommitdiff
path: root/cmd/podman/pod_stop.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-09-23 18:04:29 -0400
committerMatthew Heon <matthew.heon@gmail.com>2018-10-02 12:05:22 -0400
commit2c7f97d5a782d35efc195baf7a7ca9016ca05409 (patch)
tree2fe809fca125f2b1f425ba4a23e23a7ed10dbbae /cmd/podman/pod_stop.go
parent89c5804fe0ca3ece7587adb5d5c974dbc494f721 (diff)
downloadpodman-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/pod_stop.go')
-rw-r--r--cmd/podman/pod_stop.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/podman/pod_stop.go b/cmd/podman/pod_stop.go
index 03d04a3ec..6dc6a2b2d 100644
--- a/cmd/podman/pod_stop.go
+++ b/cmd/podman/pod_stop.go
@@ -50,9 +50,11 @@ func podStopCmd(c *cli.Context) error {
// in which case the following loop will be skipped.
pods, lastError := getPodsFromContext(c, runtime)
+ ctx := getContext()
+
for _, pod := range pods {
// set cleanup to true to clean mounts and namespaces
- ctr_errs, err := pod.Stop(true)
+ ctr_errs, err := pod.Stop(ctx, true)
if ctr_errs != nil {
for ctr, err := range ctr_errs {
if lastError != nil {