ctr export strictly matching#7615
Conversation
|
Hi @turan18. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: Yasin Turan <[email protected]>
|
Fixes #6812? |
No. This commit addresses purely exporting images that are not generated via a checkpoint. I don't believe exporting checkpoint images is currently supported. |
When attempting to export an image without providing a specific platform(s)( eg:
ctr i export <output.tar> <image_ref>) , ctr returns an error:ctr: content digest sha256:<hash>: not found. ctr exports default matcher platforms.Default() , uses the Only() match comparer which matches for a single platform and all its variants (IE linux/amd64 and linux/386). The index/manifest list that is pulled when usingctr i pull <image_ref>( without providing--all-platformsor--platformoptions) only pulls the platform that is relevant to the users machine(eg: only linux/amd64). Although the manifest contains references to different platforms only the default(host machines platform) content is pulled. The export function matches loosely against the different platformed manifests and as a result fails when attempting to retrieve manifest content that does not exist (eg: for an amd/64 machine the manifest for 386 does not exist for an image pulled, at least, without specifying it explicitly when pulling/using the all platforms option).This commit changes the behavior to adopt strictly matching platform using platforms.DefaultStrict() which would match only with a single type of a platform (eg: only amd/64) using the OnlyStrict() match comparer when exporting without the
--platformor--all-platformoptions. This change is similar to that introduced in this PR- #6906 which addresses a similar bug for ctr import - #6441.Fixes: #5895
Signed-off-by: Yasin Turan [email protected]