Skip to content

Conversation

@jedevc
Copy link
Member

@jedevc jedevc commented Jun 30, 2023

🛠️ Fix docker/buildx#1813 (comment) (see point 2 in #3891 (comment))
⬆️ Fixes up #3251

cc @vvoland @rumpl

In #3251, we added an overly restrictive check for unpackImage which, while preventing it from unpacking images with no layers, also prevented it from unpacking multi-platform images.

This PR pushes the check further down into unpackImage, so that we can still unpack multi-platform images.

(Maybe also worth a cherry-pick back to the v0.11 branch?)

jedevc added 2 commits June 30, 2023 14:48
The original commit (fddd129) that
added this test did so to check that empty layers wouldn't be unpacked
which would cause a nil de-reference.

However, `unpack` wasn't added to the export test, so the test wasn't
actually testing the changed behavior.

Signed-off-by: Justin Chadwell <[email protected]>
fddd129 added an overly broad check for
preventing unpacking scratch objects, which also prevents unpacking any
multi-platform images (which instead use `src.Refs`).

We can push the nil check down into unpackImage, and also use the
`FindRef` result helper to simplify to the Ref(s).

Signed-off-by: Justin Chadwell <[email protected]>
Copy link
Collaborator

@vvoland vvoland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in Moby; LGTM!

@tonistiigi tonistiigi merged commit 2c0cf71 into moby:master Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants