ocidir: Handle case when index entry has no platform annotation#73
Merged
cgwalters merged 1 commit intobootc-dev:mainfrom Apr 27, 2026
Merged
Conversation
The OCI image-index spec marks the `platform` field on index entries as OPTIONAL. A single-manifest OCI layout produced by tools like `skopeo copy containers-storage:... oci:/path:tag` typically omits this field entirely, which previously caused `open_image_this_platform` to fail with a "no manifest found for platform" error even though the image is perfectly valid. Match what other container runtimes do - directly inspect the manifest and find the platform from the config. The same fallback is applied inside `resolve_manifest_list` for entries inside a nested image index. Assisted-by: OpenCode (claude-sonnet-4-6@default) Signed-off-by: Colin Walters <walters@verbum.org>
There was a problem hiding this comment.
Code Review
This pull request introduces a fallback mechanism for OCI platform resolution when descriptors lack explicit platform annotations by reading the manifest's configuration blob. The feedback highlights that the current media type check is too restrictive and should include Docker-formatted images to ensure compatibility with tools like skopeo. Additionally, there is a concern regarding robustness; the current implementation bubbles up I/O and parse errors during the probing phase, which could cause the entire resolution to fail if a single non-native blob is corrupt or missing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The OCI image-index spec marks the
platformfield on index entries asOPTIONAL. A single-manifest OCI layout produced by tools like
skopeo copy containers-storage:... oci:/path:tagtypically omits this field entirely,which previously caused
open_image_this_platformto fail with a"no manifest found for platform" error even though the image is perfectly
valid.
Match what other container runtimes do - directly inspect the manifest
and find the platform from the config.
The same fallback is applied inside
resolve_manifest_listfor entries insidea nested image index.
Assisted-by: OpenCode (claude-sonnet-4-6@default)