summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-04-24 20:33:17 +0200
committerGitHub <noreply@github.com>2020-04-24 20:33:17 +0200
commita49d5c9c2f0b62fec115c8ecda37f378c12707e9 (patch)
treee31eaa5645719d5a8428b28e7f1ec5e8226f6629 /pkg
parent3c3adac52838bc4d2b0fdda2cbb8366c81444728 (diff)
parentbd7cad775aadb4a580e46a7ce62d127508c2ed07 (diff)
downloadpodman-a49d5c9c2f0b62fec115c8ecda37f378c12707e9.tar.gz
podman-a49d5c9c2f0b62fec115c8ecda37f378c12707e9.tar.bz2
podman-a49d5c9c2f0b62fec115c8ecda37f378c12707e9.zip
Merge pull request #5974 from giuseppe/fix-init
[v2] containers, init: skip invalid state errors with --all
Diffstat (limited to 'pkg')
-rw-r--r--pkg/domain/infra/abi/containers.go8
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