Skip to content

Commit d7779a5

Browse files
committed
fix: stop pulling wrong platform for images
Attempt to fix intermittent issue with images being pulled with the wrong platform for multi-platform images. The Claude did the analysis, and I think the root cause is that the `DefaultSpec()` we used causes the match to include `variant` which is e.g. `v8` for arm64, while if the image doesn't declare the exact variant, it might skip filtering and pick up the first layer which is amd64. It is still not clear why exactly it is intermittent this way. But this change aligns it more closely with the way containerd pulls, so should be good to go. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com> (cherry picked from commit ee53a18)
1 parent eb6eb66 commit d7779a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/pkg/containers/image/image.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func Pull(ctx context.Context, registryBuilder RegistriesBuilder, client *contai
123123
containerd.WithPullUnpack,
124124
containerd.WithResolver(resolver),
125125
containerd.WithChildLabelMap(images.ChildGCLabelsFilterLayers),
126-
containerd.WithPlatformMatcher(platforms.OnlyStrict(platforms.DefaultSpec())),
126+
containerd.WithPlatformMatcher(platforms.Default()),
127127
); err != nil {
128128
err = fmt.Errorf("failed to pull image %q: %w", ref, err)
129129
if errors.Is(err, errdefs.ErrNotFound) {

0 commit comments

Comments
 (0)