Merge pull request #5974 from giuseppe/fix-init

[v2] containers, init: skip invalid state errors with --all
This commit is contained in:
OpenShift Merge Robot
2020-04-24 20:33:17 +02:00
committed by GitHub
2 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -16,7 +16,6 @@ var _ = Describe("Podman init", func() {
)
BeforeEach(func() {
Skip(v2fail)
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)