-
Notifications
You must be signed in to change notification settings - Fork 185
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
fix: disable oras tag fallback to tag schema when tagging a referrer #1435
fix: disable oras tag fallback to tag schema when tagging a referrer #1435
Conversation
Signed-off-by: njucjc <njucjc@gmail.com>
Hi @njucjc, thanks for contributing. Can you help explain why |
@qweeah I want to tag a referrer, but now if not specify |
That's weird because |
the registry (support referrers api as distribution-spec v1.1) appears two tags: By the way, |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1435 +/- ##
==========================================
- Coverage 85.27% 85.22% -0.05%
==========================================
Files 106 106
Lines 3796 3798 +2
==========================================
Hits 3237 3237
- Misses 334 336 +2
Partials 225 225 ☔ View full report in Codecov by Sentry. |
Just to confirm, so you are trying to avoid generating |
Although tagging a referrer artifact manifest is discouraged, it is still doable. However, re-tagging is implemented as pushing the exact manifest again to the remote server. According to the distribution-spec, if the remote server does not support referrers API, it will go for the referrers tag schema case. However, it is not necessary since the manifest is already there, we are just adding a new tag not really pushing a new manifest. In summary, tagging a referrers manifest should never go for the tag schema even if the server does not support referrers API since the referrer manifest is already there on the server. |
@qweeah Yes! |
@shizhMSFT @qweeah Is there any suggestions to fix it? The simplest way to disable the tag schema is set |
…rrers Signed-off-by: Billy Zha <jinzha1@microsoft.com>
@njucjc Yes, we should disable tag schema without adding |
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
I have added two test specs, one of them ensures that tag schema is not used after tagging to an OCI v1.0 registry (which doesn't support referrers API). @njucjc With a proper fix in |
Signed-off-by: njucjc <njucjc@gmail.com>
7599361
to
e19fdea
Compare
Signed-off-by: Billy Zha <jinzha1@microsoft.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, thanks @njucjc
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.
Oh one required change I have missed: the type assertion should be done after the error handling.
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
46b1785
to
8b7d60e
Compare
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
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.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
…ras-project#1435) Signed-off-by: njucjc <njucjc@gmail.com> Signed-off-by: Billy Zha <jinzha1@microsoft.com> Co-authored-by: Billy Zha <jinzha1@microsoft.com>
…ras-project#1435) Signed-off-by: njucjc <njucjc@gmail.com> Signed-off-by: Billy Zha <jinzha1@microsoft.com> Co-authored-by: Billy Zha <jinzha1@microsoft.com>
…ras-project#1435) Signed-off-by: njucjc <njucjc@gmail.com> Signed-off-by: Billy Zha <jinzha1@microsoft.com> Co-authored-by: Billy Zha <jinzha1@microsoft.com> Signed-off-by: Billy Zha <jinzha1@microsoft.com>
What this PR does / why we need it:
Please check the following list: