Discard errors when a pod is already removed

This was causing some CI flakes. I'm pretty sure that the pods
being removed already isn't a bug, but just the result of another
container in the pod removing it first - so no reason not to
ignore the errors.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
Matthew Heon
2023-06-02 11:41:58 -04:00
parent 398e48a24a
commit 0e47465e4a

View File

@ -795,7 +795,7 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, opts ctrRmO
for ctr, err := range podRemovedCtrs {
removedCtrs[ctr] = err
}
if err != nil {
if err != nil && !errors.Is(err, define.ErrNoSuchPod) && !errors.Is(err, define.ErrPodRemoved) {
removedPods[depPod.ID()] = err
retErr = fmt.Errorf("error removing container %s dependency pods: %w", c.ID(), err)
return
@ -817,7 +817,7 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, opts ctrRmO
for ctr, err := range podRemovedCtrs {
removedCtrs[ctr] = err
}
if err != nil {
if err != nil && !errors.Is(err, define.ErrNoSuchPod) && !errors.Is(err, define.ErrPodRemoved) {
removedPods[pod.ID()] = err
retErr = fmt.Errorf("error removing container %s pod: %w", c.ID(), err)
return