From 4f7a431daf97f33a40609bd4823ed92ab8aa9ca4 Mon Sep 17 00:00:00 2001 From: cdoern Date: Mon, 4 Oct 2021 10:18:01 -0400 Subject: 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 --- libpod/container_internal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libpod/container_internal.go') diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 3f9738411..1c3de526c 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -2079,7 +2079,7 @@ func (c *Container) checkReadyForRemoval() error { return errors.Wrapf(define.ErrCtrStateInvalid, "container %s is in invalid state", c.ID()) } - if c.ensureState(define.ContainerStateRunning, define.ContainerStatePaused) { + if c.ensureState(define.ContainerStateRunning, define.ContainerStatePaused) && !c.IsInfra() { return errors.Wrapf(define.ErrCtrStateInvalid, "cannot remove container %s as it is %s - running or paused containers cannot be removed without force", c.ID(), c.state.State.String()) } -- cgit v1.2.3-54-g00ecf