diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2020-04-24 16:52:55 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2020-04-24 17:33:27 +0200 |
commit | bd7cad775aadb4a580e46a7ce62d127508c2ed07 (patch) | |
tree | 9568d632a024bd6024570a48a41c89a1582aaf48 /pkg/domain | |
parent | 81c7a2444cb5cbf8b8911cdb59446a239f89168c (diff) | |
download | podman-bd7cad775aadb4a580e46a7ce62d127508c2ed07.tar.gz podman-bd7cad775aadb4a580e46a7ce62d127508c2ed07.tar.bz2 podman-bd7cad775aadb4a580e46a7ce62d127508c2ed07.zip |
containers, init: skip invalid state errors with --all
reintroduce the same check that exists in v1.9.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg/domain')
-rw-r--r-- | pkg/domain/infra/abi/containers.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go index a77b18ce1..9844d1d96 100644 --- a/pkg/domain/infra/abi/containers.go +++ b/pkg/domain/infra/abi/containers.go @@ -837,7 +837,13 @@ func (ic *ContainerEngine) ContainerInit(ctx context.Context, namesOrIds []strin } for _, ctr := range ctrs { report := entities.ContainerInitReport{Id: ctr.ID()} - report.Err = ctr.Init(ctx) + err := ctr.Init(ctx) + + // If we're initializing all containers, ignore invalid state errors + if options.All && errors.Cause(err) == define.ErrCtrStateInvalid { + err = nil + } + report.Err = err reports = append(reports, &report) } return reports, nil |