summaryrefslogtreecommitdiff
path: root/libpod/runtime_pod_linux.go
diff options
context:
space:
mode:
authorcdoern <cdoern@redhat.com>2021-10-04 10:18:01 -0400
committerMatthew Heon <matthew.heon@pm.me>2021-11-12 11:08:25 -0500
commit3b67336b608efd72a0e7a023b85b1b3dc2dc4746 (patch)
tree8de77f2d0aeeca7a653db1572d4ea58959392ff7 /libpod/runtime_pod_linux.go
parentf8ede7c5ed01324f47ebc01f69c11ab1046e1ebb (diff)
downloadpodman-3b67336b608efd72a0e7a023b85b1b3dc2dc4746.tar.gz
podman-3b67336b608efd72a0e7a023b85b1b3dc2dc4746.tar.bz2
podman-3b67336b608efd72a0e7a023b85b1b3dc2dc4746.zip
Pod Rm Infra Improvements
Made changes so that if the pod contains all exited containers and only infra is running, remove the pod. resolves #11713 Signed-off-by: cdoern <cdoern@redhat.com>
Diffstat (limited to 'libpod/runtime_pod_linux.go')
-rw-r--r--libpod/runtime_pod_linux.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/libpod/runtime_pod_linux.go b/libpod/runtime_pod_linux.go
index a90ea6125..3a6098de8 100644
--- a/libpod/runtime_pod_linux.go
+++ b/libpod/runtime_pod_linux.go
@@ -177,10 +177,9 @@ func (r *Runtime) removePod(ctx context.Context, p *Pod, removeCtrs, force bool)
if err != nil {
return err
}
-
numCtrs := len(ctrs)
- // If the only container in the pod is the pause container, remove the pod and container unconditionally.
+ // If the only running container in the pod is the pause container, remove the pod and container unconditionally.
pauseCtrID := p.state.InfraContainerID
if numCtrs == 1 && ctrs[0].ID() == pauseCtrID {
removeCtrs = true