[24.0 backport] Don't return an error if the lease is not found #46300
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.
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
And this Dockerfile:
FROM alpine
Run the compose project once:
$ docker compose up
Then run it but with a preferred platform specified:
Before:
After:
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)