-
Notifications
You must be signed in to change notification settings - Fork 547
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
accepts attachment-tag-prefix
for cosign copy
#3014
accepts attachment-tag-prefix
for cosign copy
#3014
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3014 +/- ##
==========================================
+ Coverage 30.23% 30.45% +0.21%
==========================================
Files 151 152 +1
Lines 9478 9584 +106
==========================================
+ Hits 2866 2919 +53
- Misses 6167 6208 +41
- Partials 445 457 +12
|
Signed-off-by: Mritunjay <mritunjaysharma394@gmail.com>
78f875e
to
ff25b99
Compare
@mritunjaysharma394 Thanks for the PR. Would you mind adding a test to validate the problem reported in the issue? |
Signed-off-by: Mritunjay <mritunjaysharma394@gmail.com>
Hi @hectorj2f, thanks for the quick review, I was a little unsure of how to get tag/hash/digest for the test code to verify if the tag-prefix worked the way we want or not since in test-code, I assume we arent talking to the remote registry. However, I still tried to write one, feel free to review and help me with improvements, here's the debug console output which shows it works, thanks a lot: |
Also @hectorj2f, I just checked it with the repro that @znewman01 mentioned while creating the issue, I followed the exact steps and it seems to be working now: |
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 except the one question I had
Signed-off-by: Mritunjay <mritunjaysharma394@gmail.com>
LGTM, thank you so much! |
Thanks for fixing the issue, When it will be available for me to download. |
Should have a new release Real Soon Now (TM): sigstore/sigstore#1166 (comment) :) |
@@ -102,6 +109,7 @@ func CopyCmd(ctx context.Context, regOpts options.RegistryOptions, srcImg, dstIm | |||
// Copy the entity itself. | |||
g.Go(func() error { | |||
dst := dstRepoRef.Tag(srcDigest.Identifier()) | |||
dst = dst.Tag(fmt.Sprint(regOpts.RefOpts.TagPrefix, h.Algorithm, "-", h.Hex)) |
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.
This means we will never copy the tag itself 🤔
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.
Honestly, I'm not sure what dstRepoRef.Tag(srcDigest.Identifier())
is even meant to do either 😅
Summary
This PR was created in an attempt that closes #2962 where in the case of
cosign copy
,attachment-tag-prefix
was ignored.Release Note
Fixed
cosign copy
ignoringattachment-tag-prefix
flagDocumentation
Nope, I guess.