mirror of
https://github.com/containers/podman.git
synced 2025-06-20 17:13:43 +08:00
Merge pull request #5974 from giuseppe/fix-init
[v2] containers, init: skip invalid state errors with --all
This commit is contained in:
@ -837,7 +837,13 @@ func (ic *ContainerEngine) ContainerInit(ctx context.Context, namesOrIds []strin
|
|||||||
}
|
}
|
||||||
for _, ctr := range ctrs {
|
for _, ctr := range ctrs {
|
||||||
report := entities.ContainerInitReport{Id: ctr.ID()}
|
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)
|
reports = append(reports, &report)
|
||||||
}
|
}
|
||||||
return reports, nil
|
return reports, nil
|
||||||
|
@ -16,7 +16,6 @@ var _ = Describe("Podman init", func() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
Skip(v2fail)
|
|
||||||
tempdir, err = CreateTempDirInTempDir()
|
tempdir, err = CreateTempDirInTempDir()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
Reference in New Issue
Block a user