fix: resolve platform detection in archives missing index metadata#750
Draft
fix: resolve platform detection in archives missing index metadata#750
Conversation
…dex metadata Modern Docker versions often produce OCI archives where individual manifests in the index.json lack platform information. This caused the OCI extractor to fail when multiple manifests were present because it couldn't disambiguate them. This fix allows the extractor to resolve platform information from image configuration blobs as a fallback.
adrobuta
approved these changes
Feb 19, 2026
adrobuta
reviewed
Feb 19, 2026
| return { | ||
| os: config.os, | ||
| architecture: config.architecture, | ||
| }; |
Contributor
There was a problem hiding this comment.
should we return the variant too here?
adrobuta
reviewed
Feb 19, 2026
| }; | ||
| if (target.platform) { | ||
| return { | ||
| os: target.platform.os, |
Contributor
There was a problem hiding this comment.
is there a reason here why we switched from optional chaining to direct access?
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.
Modern Docker versions often produce OCI archives where individual manifests in the index.json lack platform information. This caused the OCI extractor to fail when multiple manifests were present because it couldn't disambiguate them. This fix allows the extractor to resolve platform information from image configuration blobs as a fallback.
What does this PR do?
Modern Docker versions often produce OCI archives where individual manifests in the index.json lack platform information. This caused the OCI extractor to fail when multiple manifests were present because it couldn't disambiguate them. This fix allows the extractor to resolve platform information from image configuration blobs as a fallback.
Where should the reviewer start?
N/A
How should this be manually tested?
Create a tar archive containing multiple manifests from a modern docker daemon with containerd disabled as the image store. Running
snyk container teston such an image fails with existing public versions of the CLI. Runningsnyk container testwith this commit succeeds.Any background context you want to provide?
https://snyk.slack.com/archives/C85H8Q12Q/p1769554752582849
What are the relevant tickets?