summaryrefslogtreecommitdiff
path: root/libpod/runtime_pod_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/runtime_pod_linux.go')
-rw-r--r--libpod/runtime_pod_linux.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/libpod/runtime_pod_linux.go b/libpod/runtime_pod_linux.go
index dd57007e0..974cd2b68 100644
--- a/libpod/runtime_pod_linux.go
+++ b/libpod/runtime_pod_linux.go
@@ -222,7 +222,7 @@ func (r *Runtime) removePod(ctx context.Context, p *Pod, removeCtrs, force bool)
// As we have guaranteed their dependencies are in the pod
for _, ctr := range ctrs {
// Clean up network namespace, cgroups, mounts
- if err := ctr.cleanup(); err != nil {
+ if err := ctr.cleanup(ctx); err != nil {
return err
}
@@ -233,7 +233,8 @@ func (r *Runtime) removePod(ctx context.Context, p *Pod, removeCtrs, force bool)
// Delete the container from runtime (only if we are not
// ContainerStateConfigured)
- if ctr.state.State != ContainerStateConfigured {
+ if ctr.state.State != ContainerStateConfigured &&
+ ctr.state.State != ContainerStateExited {
if err := ctr.delete(ctx); err != nil {
return err
}