feat!: implement the referrers route in the v2 package#32
Merged
shizhMSFT merged 3 commits intooras-project:mainfrom Nov 4, 2022
wangxiaoxuan273:v2-pkg
Merged
feat!: implement the referrers route in the v2 package#32shizhMSFT merged 3 commits intooras-project:mainfrom wangxiaoxuan273:v2-pkg
shizhMSFT merged 3 commits intooras-project:mainfrom
wangxiaoxuan273:v2-pkg
Conversation
Codecov Report
@@ Coverage Diff @@
## main #32 +/- ##
=======================================
Coverage 57.18% 57.18%
=======================================
Files 107 107
Lines 10982 10990 +8
=======================================
+ Hits 6280 6285 +5
- Misses 3999 4001 +2
- Partials 703 704 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
shizhMSFT
requested changes
Nov 1, 2022
registry/api/v2/descriptors.go
Outdated
| Description: "Fetch the referrers of the artifact identified by `digest`.", | ||
| Requests: []RequestDescriptor{ | ||
| { | ||
| Name: "referrers", |
There was a problem hiding this comment.
nit:
Suggested change
| Name: "referrers", | |
| Name: "Referrers", |
registry/api/v2/descriptors.go
Outdated
Comment on lines
+1626
to
+1633
| Format: `{ | ||
| "schemaVersion": 2, | ||
| "mediaType": "application/vnd.oci.image.index.v1+json", | ||
| "manifests": [ | ||
| <manifest>, | ||
| ... | ||
| ] | ||
| }`, |
registry/api/v2/descriptors.go
Outdated
| linkHeader, | ||
| }, | ||
| Body: BodyDescriptor{ | ||
| ContentType: "application/json", |
There was a problem hiding this comment.
Should it be application/vnd.oci.image.index.v1+json?
Comment on lines
+1638
to
+1641
| { | ||
| Description: "The registry does not support referrers API.", | ||
| StatusCode: http.StatusNotFound, | ||
| }, |
There was a problem hiding this comment.
It is also possible that the repository does not exists.
/cc @Wwwsylvia @m5i-work
Member
There was a problem hiding this comment.
We should return 404 and error code NAME_UNKNOWN when the repository does not exist.
References:
Author
Signed-off-by: wangxiaoxuan273 <wangxiaoxuan119@gmail.com>
Signed-off-by: wangxiaoxuan273 <wangxiaoxuan119@gmail.com>
Signed-off-by: wangxiaoxuan273 <wangxiaoxuan119@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Implement the
referrersroute in theregistry/api/v2package. Path with filtering onArtifactTypeis also implemented. Unit tests are included. The next pr will implementreferrersHandlerbut probably will not implement filtering yet.Part 5 of #21
Signed-off-by: wangxiaoxuan273 wangxiaoxuan119@gmail.com