mirror of
https://github.com/containers/podman.git
synced 2025-10-18 19:53:58 +08:00
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>
This commit is contained in:
@ -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())
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user