Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkg/cmd/container/run_mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package container
import (
"context"
"encoding/json"
"errors"
"fmt"
"os"
"path/filepath"
Expand Down Expand Up @@ -307,6 +308,12 @@ func generateMountOpts(ctx context.Context, client *containerd.Client, ensuredIm
for _, c := range containers {
ls, err := c.Labels(ctx)
if err != nil {
// Containerd note: there is no guarantee that the containers we got from the list still exist at this point
// If that is the case, just ignore and move on
if errors.Is(err, errdefs.ErrNotFound) {
log.G(ctx).Debugf("container %q is gone - ignoring", c.ID())
continue
}
return nil, nil, nil, err
}
_, idMatch := vfSet[c.ID()]
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/volume/rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func usedVolumes(ctx context.Context, containers []containerd.Container) (map[st
// Containerd note: there is no guarantee that the containers we got from the list still exist at this point
// If that is the case, just ignore and move on
if errors.Is(err, errdefs.ErrNotFound) {
log.G(ctx).Debugf("container %q is gone - ignoring", c.ID())
continue
}
return nil, err
Expand Down