digest: Preserve tag and digest in With* functions#2044
digest: Preserve tag and digest in With* functions#2044dmcgowan merged 1 commit intodistribution:masterfrom
Conversation
When WithDigest is called on a reference that has a tag, it should preserve the tag. When WithTag is called on a reference that has digest, it should preserve the digest. Signed-off-by: Aaron Lehmann <[email protected]>
|
Nice, thanks @aaronlehmann! LGTM |
|
LGTM |
|
Thanks Nishant. If you want to use this in github.com/moby/moby/pull/28173, make sure to import the For now I think it's okay to manipulate the reference string manually, and we can switch to this corrected |
Current coverage is 51.41% (diff: 100%)@@ master #2044 diff @@
==========================================
Files 126 126
Lines 11263 11275 +12
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
- Hits 6927 5797 -1130
- Misses 3449 4732 +1283
+ Partials 887 746 -141
|
|
@aaronlehmann Note that docker will not save this tag. If I remember this correctly then this was made so that |
|
@tonistiigi: That's probably okay. We want to display the tag in |
|
Will we need to make any updates where comparisons are done? I think the correct thing for the caller to do if both tag/digest are not wanted is to strip the reference down to just a name before calling this function. Not sure we currently have a helper for this. |
|
I'm not sure. The reference store seems to use But is it bad if the image is now stored as Either way, we need to test this stuff when we vendor. |
It's not only matching(although I find current behavior useful). Api exports |
|
I think this is failing the trust tests for me, the tests are sensitive but looking for "repo@digest" in |
|
Created #2053 to address this |
|
@dmcgowan when can we vendor the distribution repo into Docker next? |
|
@nishanttotla I will be vendoring master with moby/moby#28235 once CI completes on that linked issue. I should have all the vendoring issues fixed in that PR. |
|
@dmcgowan thanks! |
When
WithDigestis called on a reference that has a tag, it shouldpreserve the tag.
When
WithTagis called on a reference that has digest, it shouldpreserve the digest.
cc @stevvooe @dmcgowan @nishanttotla