[27.x backport] Touch-up some errors for missing platforms#48691
Merged
[27.x backport] Touch-up some errors for missing platforms#48691
Conversation
Without containerd store enabled, we were discarding underlying errors,
and instead informing the user that `--platform` is not suported;
docker pull --quiet --platform=linux/riscv64 alpine:latest
docker image push --platform=linux/amd64 alpine:latest
Error response from daemon: graphdriver backed image store doesn't support multiplatform images
However, that's not the case; platform filtering works, but if the image
is not the right platform, the push fails (which is the same as would
happen with the containerd image store enabled).
docker image push --platform=linux/amd64 alpine:latest
Error response from daemon: image with reference docker.io/library/alpine:latest was found but does not match the specified platform: wanted linux/amd64, actual: linux/riscv64
When specifying the platform and that platform matches, it finds the image,
and the push continue;
docker image push --platform=linux/riscv64 alpine:latest
The push refers to repository [docker.io/library/alpine]
3fd4750fd687: Layer already exists
...
(The above example obviously fails because I don't have permissions to
push official images).
Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit d31c241)
Signed-off-by: Paweł Gronowski <[email protected]>
Slightly touching up the error message, because the "wanted/actual" output
felt too much like a assertion failure in a test-case.
- Format the image-reference using "familiar" format, which shows the
image's short name for official images.
- Move the actual and requested platforms to be a part of the sentence,
but within braces.
Before this patch:
docker image push --platform=linux/amd64 alpine:latest
Error response from daemon: image with reference docker.io/library/alpine:latest was found but does not match the specified platform: wanted linux/amd64, actual: linux/riscv64
With this patch:
docker image push --platform=linux/amd64 alpine:latest
Error response from daemon: image with reference alpine:latest was found but its platform (linux/riscv64) does not match the specified platform (linux/amd64)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 8681b3c)
Signed-off-by: Paweł Gronowski <[email protected]>
- Changed "match" to "provide", in an attempt to indicate that the image is
a multi-platform image that doesn't contain the given platform.
- Remove the "wanted" and instead make the requested platforms to be a part
of the sentence, but within braces.
Before this patch:
docker pull --quiet --platform=linux/riscv64 alpine:latest
docker image history --platform=linux/amd64 alpine
Error response from daemon: image with reference alpine:latest was found but does not match the specified platform: wanted linux/amd64
With this patch:
docker pull --quiet --platform=linux/riscv64 alpine:latest
docker image history --platform=linux/amd64 alpine
Error response from daemon: image with reference alpine:latest was found but does not provide the specified platform (linux/amd64)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Paweł Gronowski <[email protected]>
…rrors
The platform was printed in its raw format, which didn't produce a very
readable output;
Before this change:
$ docker image push --platform=linux/amd64 alpine:arm64
Error response from daemon: no suitable image manifest found for platform {amd64 linux [] }
After this change:
$ docker image push --platform=linux/amd64 alpine:arm64
Error response from daemon: no suitable image manifest found for platform linux/amd64
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Paweł Gronowski <[email protected]>
Member
|
Thank you! I marked this as "supersedes #48632", which was my initial backport that I needed to update ❤️ |
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.
--platformflag to history, save and load docker/cli#5331NOTE: last 2 commits are reworked so they can be applied to the 27.x branch
PushImage: remove misleading error about --platform without containerd
Without containerd store enabled, we were discarding underlying errors,
and instead informing the user that
--platformis not suported;However, that's not the case; platform filtering works, but if the image
is not the right platform, the push fails (which is the same as would
happen with the containerd image store enabled).
When specifying the platform and that platform matches, it finds the image,
and the push continue;
(The above example obviously fails because I don't have permissions to
push official images).
images: GetImage: touch-up error message for missing platform
Slightly touching up the error message, because the "wanted/actual" output
felt too much like a assertion failure in a test-case.
image's short name for official images.
but within braces.
Before this patch:
With this patch:
daemon/containerd: touch-up platform not found error
daemon/containerd: getPushDescriptor: fix formatting of platform in errors