Skip to content

Misalignment between fetch platform.MatchComparer and other method #2991

@ibuildthecloud

Description

@ibuildthecloud

Description

This issue pops up pretty easily when pulling images on a armv7 host and the manifest list has both arm v6 and v7 variants.

The default platform matcher is platform.Only() which has a specific check to pick any arm architecture with a compatible variant (v7 allows v7, v6, v5 for example). During the fetch phase the best match of the manifest list will be chosen (due to the LimitHandler limiting to 1) and only that variant is download. Then any call to Unpack, image.Config, image.Size and maybe others will fail. This is because the same platform.MatchComparer is used that will select any valid variant, but only one variant has been downloaded.

Steps to reproduce the issue:

  1. On a fresh install of containerd run ````ctr image pull --platform linux/arm/v7 docker.io/library/nats-streaming:0.11.2```
    Or
  2. Run containerd on a armv7 host and do client.Pull and do not pass the platform so you get the default

Describe the results you received:

index-sha256:b25585f075e6578613bd73779efb880e9a47c487ba101c0313272a7ebee38045:    exists         |++++++++++++++++++++++++++++++++++++++| 
manifest-sha256:3773064c3045cc5b5f13b5ea01dd25629ddea82e6ef38b904d9641807c8ca280: done           |++++++++++++++++++++++++++++++++++++++| 
config-sha256:4157ba5bd3e5fe8dd14fc9a311ffea11d351d583a6754ba076c5bc029ea49ef0:   done           |++++++++++++++++++++++++++++++++++++++| 
layer-sha256:c415cdacdbd92ff8df33831be11e3bb15d7cf05fd47fba0d6f94d23d49570e4d:    done           |++++++++++++++++++++++++++++++++++++++| 
elapsed: 1.2 s                                                                    total:  861.2  (717.5 KiB/s)                                     
unpacking linux/arm/v7 sha256:b25585f075e6578613bd73779efb880e9a47c487ba101c0313272a7ebee38045...
ctr: content digest sha256:7e017539fea5acae9f6721b853ee545159f74be7fcacd061351f1e0b977c3d1b: not found

Output of containerd --version:

It's v1.2.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions