-
Notifications
You must be signed in to change notification settings - Fork 202
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
Only return one image ID, and hopefully a more precise one, from pulling. #2202
Conversation
Ephemeral COPR build failed. @containers/packit-build please check. |
Interesting. Do you think this would also fix the expected-layer-diffid error that I'm seeing in #24280? |
Completely unrelated, please file that separately. |
I would if I could reproduce it. I'll keep trying tomorrow. |
In containers/podman#24287 I have confirmed that we now no longer output two IDs, and the test seems to be passing. This is ready for review. |
libimage/pull.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
return []string{pulled}, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be nil, to make it clearer to future maintainers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Fixed,
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
If we can't find the image we have just pulled by digest, the image was probably already removed, and returning candidate.Value could only possibly point at a _different_ image with the same tag. Instead, fail immediately. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
There's no benefit in returning multiple matches; we ideally want to return exactly the image we pulled, but even if that were hard, returning multiple guesses is not what the user asked for. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
... because we now never return more than one. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
- Use the image's repo, not just the digest, to be more precise when zstd:chunked ambiguities are involved - Remove the multi-platform lookup code, it is never used Signed-off-by: Miloslav Trmač <mitr@redhat.com>
LGTM |
go mod edit -replace github.com/containers/common=github.com/mtrmac/common@only-one-pull Signed-off-by: Miloslav Trmač <mitr@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Luap99, mtrmac The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This should fix containers/storage#2130 (comment) .
Untested at this point.Reading the code makes it tempting to keep refactoring and improving, but to keep the scope reasonable, I have just added FIXMEs.
Cc: @edsantiago