Do not process images with unprocessable layers#497
Merged
Conversation
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Benchmark Test ResultsBenchmark results from the latest changes vs base branch |
wagoodman
commented
Jan 8, 2026
| return nil, err | ||
| } | ||
|
|
||
| log.WithFields("image", p.imageStr, "time", time.Since(startTime)).Info("completed downloading image") |
Contributor
Author
There was a problem hiding this comment.
this makes it sound like we've pulled the image contents, but in actuality it's just the manifest (that's why this log line changed)
kzantow
approved these changes
Jan 8, 2026
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.
Today we only check if a layer's media type is supported when we actually process that layer (downloading the contents just after that). If an image has 10 layers and the last one is unprocessable, we've already wasted time pulling and processing the first 9 layers.
This PR fixes this behavior by checking all layer media types upfront in
Image.Read()before doing any real work. If any layer can't be processed, fail immediately before we pull any contents.