fix: docker pull with platform checks wrong image tag#45561
Merged
neersighted merged 1 commit intomoby:masterfrom May 18, 2023
Merged
fix: docker pull with platform checks wrong image tag#45561neersighted merged 1 commit intomoby:masterfrom
docker pull with platform checks wrong image tag#45561neersighted merged 1 commit intomoby:masterfrom
Conversation
This fixes a bug where, if a user pulls an image with a tag != `latest` and a specific platform, we return an NotFound error for the wrong (`latest`) tag. see: moby#45558 This bug was introduced in moby@779a5b3 in the changes to `daemon/images/image_pull.go`, when we started returning the error from the call to `GetImage` after the pull. We do this call, if pulling with a specified platform, to check if the platform of the pulled image matches the requested platform (for cases with single-arch images). However, when we call `GetImage` we're not passing the image tag, only name, so `GetImage` assumes `latest` which breaks when the user has requested a different tag, since there might not be such an image in the store. Signed-off-by: Laura Brehm <laurabrehm@hey.com>
vvoland
approved these changes
May 18, 2023
rumpl
approved these changes
May 18, 2023
Member
Author
|
Failure looks unrelated: https://github.com/moby/moby/actions/runs/5013915789/jobs/8987581073?pr=45561 |
neersighted
approved these changes
May 18, 2023
|
Thanks @laurazard and everyone else involved for getting this fixed! |
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.
- Related
- What I did
Fix a bug where, if a user pulls an image with a tag !=
latestand a specific platform, we return an NotFound error for the wrong (latest) tag. see: #45558This bug was introduced in 779a5b3 in the changes to
daemon/images/image_pull.go, when we started returning the error from the call toGetImageafter the pull.We started doing this call – in 424c0eb – if pulling with a specified platform, to check if the platform of the pulled image matches the requested platform (for cases with single-arch images). However, when we call
GetImagewe're not passing the image tag, only name, soGetImageassumeslatestwhich breaks when the user has requested a different tag.- How I did it
- How to verify it
docker pull --platform amd64 quay.io/ansible/docker-test-containers:hello-world- Description for the changelog
fix error when pulling an image for a specific platform when tag != "latest"- A picture of a cute animal (not mandatory but encouraged)