This is on ARM64.
I have a Platform object that I got from Platform::default().
I have a list of Descriptors that I got from the manifests() function on the index for docker://alpine.
I'm trying to find an image that I can run on the current Platform. My current code just does a strict equality check on the two Platforms. This fails because the alpine container has the "v8" variant set.
I can obviously fix this by stripping off variants, but I would like a way to do this the correct way.
One way to do this would be to have "normalize" functions, like this: https://github.com/containerd/containerd/blob/v1.4.3/platforms/database.go#L83
I could normalize both Platforms and use strict equality checking.
I think a better way would be to have a method on Platform like can_be_run_on, or can_run, that takes another Platform.
I'm happy to provide a PR, but would like some input on the preferred direction before I do so.
This is on ARM64.
I have a
Platformobject that I got fromPlatform::default().I have a list of
Descriptorsthat I got from themanifests()function on the index fordocker://alpine.I'm trying to find an image that I can run on the current
Platform. My current code just does a strict equality check on the twoPlatforms. This fails because the alpine container has the"v8"variant set.I can obviously fix this by stripping off variants, but I would like a way to do this the correct way.
One way to do this would be to have "normalize" functions, like this: https://github.com/containerd/containerd/blob/v1.4.3/platforms/database.go#L83
I could normalize both
Platforms and use strict equality checking.I think a better way would be to have a method on
Platformlikecan_be_run_on, orcan_run, that takes anotherPlatform.I'm happy to provide a PR, but would like some input on the preferred direction before I do so.