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 | |
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>
-rw-r--r-- | pkg/domain/infra/abi/containers.go | 8 | ||||
-rw-r--r-- | test/e2e/init_test.go | 1 |
2 files changed, 7 insertions, 2 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 diff --git a/test/e2e/init_test.go b/test/e2e/init_test.go index 6241f813f..919fe4abf 100644 --- a/test/e2e/init_test.go +++ b/test/e2e/init_test.go @@ -16,7 +16,6 @@ var _ = Describe("Podman init", func() { ) BeforeEach(func() { - Skip(v2fail) tempdir, err = CreateTempDirInTempDir() if err != nil { os.Exit(1) |