Skip to content

Commit 2c6fb77

Browse files
committed
Alleviate image --filter missing digest issue
Signed-off-by: apostasie <[email protected]>
1 parent 57bafac commit 2c6fb77

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/imgutil/filtering.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828

2929
containerd "github.com/containerd/containerd/v2/client"
3030
"github.com/containerd/containerd/v2/core/images"
31+
"github.com/containerd/log"
3132

3233
"github.com/containerd/nerdctl/v2/pkg/referenceutil"
3334
)
@@ -240,7 +241,10 @@ func FilterByLabel(ctx context.Context, client *containerd.Client, labels map[st
240241
clientImage := containerd.NewImage(client, i)
241242
imageCfg, _, err := ReadImageConfig(ctx, clientImage)
242243
if err != nil {
243-
return false, err
244+
// Stop-gap measure. Do not hard error if some images config cannot be read.
245+
// See https://github.com/containerd/nerdctl/issues/3516
246+
log.G(ctx).WithError(err).Errorf("failed reading image config for %s (%s)", clientImage.Name(), clientImage.Platform())
247+
return false, nil
244248
}
245249
return matchesAllLabels(imageCfg.Config.Labels, labels), nil
246250
})

0 commit comments

Comments
 (0)