Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[24.0 backport] Don't return an error if the lease is not found #46300

Merged
merged 1 commit into from Aug 23, 2023

Conversation

thaJeztah
Copy link
Member

If the image for the wanted platform doesn't exist then the lease doesn't exist either. Returning this error hides the real error, so let's not return it.

(cherry picked from commit b8ff8ea)


- What I did

#43939 changed the signature of manifestMatchesPlatform and started returning the lease error, the issue is that, if the image for the wanted platform doesn't exist, then the lease doesn't exist either. We shouldn't return an error if the lease is not found

- How I did it

By checking the error returned when we list lease resources.

- How to verify it

With this compose file

services:
  test:
    build:
      context: .
      dockerfile: Dockerfile

And this Dockerfile:

FROM alpine

Run the compose project once:

$ docker compose up

Then run it but with a preferred platform specified:

Before:

$ DOCKER_DEFAULT_PLATFORM=linux/arm64 docker-compose up
[+] Running 0/0
 ⠋ Container compose-platform-test-1  Recreate                                                                                                                         0.0s 
Error response from daemon: lease "moby-image-sha256:e22aab0781e952e8ae9c49b2162eda23ef9a62d26a7b1e6a2d66b77f6751c45e": not found

After:

$ DOCKER_DEFAULT_PLATFORM=linux/arm64 docker-compose up
[+] Running 0/0
 ⠋ Container compose-platform-test-1  Recreate                                                                                                                         0.0s 
Error response from daemon: image with reference compose-platform-test was found but does not match the specified platform: wanted linux/arm64, actual: linux/amd64

This was reported in multiple places:

- Description for the changelog
Fixed the reported error when the local image's platform mismatches the wanted one

- A picture of a cute animal (not mandatory but encouraged)

If the image for the wanted platform doesn't exist then the lease
doesn't exist either. Returning this error hides the real error, so
let's not return it.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
(cherry picked from commit b8ff8ea)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added status/2-code-review impact/changelog kind/bugfix PR's that fix bugs containerd-integration Issues and PRs related to containerd integration labels Aug 23, 2023
@thaJeztah thaJeztah added this to the 24.0.6 milestone Aug 23, 2023
@thaJeztah thaJeztah added area/images and removed containerd-integration Issues and PRs related to containerd integration labels Aug 23, 2023
@thaJeztah thaJeztah merged commit e0661af into moby:24.0 Aug 23, 2023
102 checks passed
@thaJeztah thaJeztah deleted the 24.0_backport_fix-platform-check branch August 23, 2023 15:41
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.

None yet

3 participants