Skip to content

Commit

Permalink
Merge pull request #19863 from mheon/fix_18874
Browse files Browse the repository at this point in the history
Ignore spurious container-removal errors
  • Loading branch information
openshift-merge-robot authored Sep 6, 2023
2 parents d7b7b20 + 71549c6 commit f14360f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libpod/runtime_ctr.go
Original file line number Diff line number Diff line change
Expand Up @@ -916,12 +916,16 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, opts ctrRmO
}
ctrs, pods, err := r.removeContainer(ctx, dep, recursiveOpts)
for rmCtr, err := range ctrs {
removedCtrs[rmCtr] = err
if errors.Is(err, define.ErrNoSuchCtr) || errors.Is(err, define.ErrCtrRemoved) {
removedCtrs[rmCtr] = nil
} else {
removedCtrs[rmCtr] = err
}
}
for rmPod, err := range pods {
removedPods[rmPod] = err
}
if err != nil {
if err != nil && !errors.Is(err, define.ErrNoSuchCtr) && !errors.Is(err, define.ErrCtrRemoved) {
retErr = err
return
}
Expand Down

0 comments on commit f14360f

Please sign in to comment.