-
Notifications
You must be signed in to change notification settings - Fork 204
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
Inconsistent and underdocumented behavior when choosing a digest #1823
Comments
A design question: If the user pulls several per-arch variants of the same multi-arch image, should the “digest” field in Either can be argued to be correct. |
@vrothberg PTAL |
I've no time to work on this in case that's the expectation.
Purely by a gut feeling: I'd vote for individual digest over common list digest. Maybe even differentiate between list digest and individual digest long term? |
This was motivated by a failure vendoring c/common due to a behavior change. Short-term we adjusted the test, and it is not urgent. This issue is filed
|
In various locations, notably user-visible “inspect” operations, we expose a single digest value for an image.
That’s fundamentally insufficient because images are deduplicated; hence
libimage.Image.Digest
has a TODO to deprecate, but we can’t completely remove it, theinspect
CLI operations would still need to output something.What exactly we output is not generally consistent, though. Three notable origins of data:
storageTransport.GetStoreImage(…).Digest
. Thec/storage.Image.Digest
value is typically, by c/image, set when the image is first created; and if it was pulled from a multi-arch image, it is the multi-arch digest.c/image/storageReference.resolveReference
, e.g.storageTransport.ResolveReference().Digest
for a tagged reference or a storage ID. The value used isBigDataDigests[storage.ImageDigestBigDataKey]
, set on the last write of a duplicate image, and if that was a multi-arch image pull, it is the per-arch digest.storageTransport.ResolveReference().Digest
when the input reference is a name@digest reference.)The practical outcome is that
podman image list
currently returnsImage.Digest
values, but things likepodman image inspect
orpodman container inspect
returnBigDataDigests[storage.ImageDigestBigDataKey]
— and the two don’t match. That’s, at the very least, counterintuitive.Fixing this should probably ensure that
libimage
consistently returns one of the values — and given the need to respect user input, probably the one fromc/image/storageReference.resolveReference
(but it is an option to change the implementation of that function).But, also, that work should probably holistically include how multi-arch/per-arch digests are chosen/treated, notably
common/libimage/manifest_list.go
Lines 201 to 205 in 4b53eca
common/libimage/runtime.go
Lines 360 to 362 in 4b53eca
The text was updated successfully, but these errors were encountered: