Repository navigation
feat: implement OCI Distribution Spec v1.1 referrers API - #4828
lemonprogis wants to merge 6 commits into
Conversation
Signed-off-by: Alistair Bush <[email protected]> Co-authored-by: Alistair Bush <[email protected]> Co-authored-by: Bracken Dawson <[email protected]> Signed-off-by: lemonprogis <[email protected]> Signed-off-by: Edward Briggler <[email protected]>
Signed-off-by: Alistair Bush <[email protected]> Signed-off-by: lemonprogis <[email protected]> Signed-off-by: Edward Briggler <[email protected]>
Signed-off-by: Alistair Bush <[email protected]> Signed-off-by: lemonprogis <[email protected]> Signed-off-by: Edward Briggler <[email protected]>
Signed-off-by: Alistair Bush <[email protected]> Signed-off-by: lemonprogis <[email protected]> Signed-off-by: Edward Briggler <[email protected]>
…{digest})
Completes the referrers API per OCI Distribution Spec v1.1 by adding
the read-side endpoint on top of the storage-layer subject linking from
the previous commits.
- Register GET /v2/{name}/referrers/{digest} route
- Implement referrersHandler returning an OCI Image Index response
- Enumerate referrer links from the filesystem storage layer
- Enrich descriptors with mediaType, artifactType, and annotations
from the manifest blob per spec requirements
- Support ?artifactType= query parameter filtering with
OCI-Filters-Applied response header
- Return empty index (not 404) when no referrers exist
- Add comprehensive TestReferrersAPI covering unfiltered listing,
artifact type filtering, non-matching filters, and empty results
Signed-off-by: lemonprogis <[email protected]>
Signed-off-by: Edward Briggler <[email protected]>
- Rename emptyJsonDescriptor to emptyJSONDescriptor (staticcheck ST1003) - Regenerate docs/content/spec/api.md from template to include the referrers route Signed-off-by: Edward Briggler <[email protected]> Signed-off-by: lemonprogis <[email protected]>
|
@milosgajdos thank you for kicking off the additional checks. I saw the failures from validation and fixed those. |
|
I dont think we'll smack it into the immediate release (i.e. the one we are planning soon), but the one after sure. |
|
@milosgajdos understood. This will be a great enhancement for what we're doing in air-gapped deployments. Where can I read up on release cadences? Is that in CNCF slack? cc @joonas for visibility |
|
There is no such thing as release cadence; Im more or less one of the few maintainers who does this in my free time, free of charge...you'll have to be patient, alas. |
|
Good day @milosgajdos! Is there an update on when this could get merged in and when 3.2.0 will be made available? |
|
can we help here to get it merged? we really like the project and from the benchmark and usage side, it checks all the boxes. we just need the OCI v1.1 to be able to use it. |
|
@thaJeztah and @milosgajdos wanted to bump this again 🙇 |
|
I'd like to get this into the next either minor or major release but we first need to cut the patch one |
|
@lemonprogis I realize the changes are near ready, but wanted to offer a few additions. I ran into these scenarios while running distribution spec conformance testing I broke apart the changes to make it easier to review and cherry-pick as desired.
Happy to follow up or assist, with these changes I believe distribution-spec conformance testing related to referrers will pass. |
|
@andrewg-xyz I'd love to take these commits. Could you add a Signed-off-by line on these commits so CI will pass after I bring them in? |
✅ |
Summary
Implements the OCI Distribution Spec v1.1 referrers API (
GET /v2/{name}/referrers/{digest}), completing the work started in #3834 and #4483.This builds on the storage-layer subject linking by @brackendawson and @alistair (cherry-picked from #4483) and adds the read-side endpoint that was left as TODO.
What's included
From #4483 (storage layer — @brackendawson, @alistair):
subjectandartifactTypefields on OCI manifest and index PUT_referrers/subject.mediaTypeis a manifest typeNew (referrers API endpoint):
GET /v2/{name}/referrers/{digest}routeapplication/vnd.oci.image.index.v1+json) with descriptors for all manifests referencing the subjectmediaType,artifactType, andannotationsfrom the manifest blob per specartifactTypeper spec: manifest field →config.mediaTypefallback?artifactType=query parameter filtering withOCI-Filters-Appliedresponse headerTests
TestReferrersAPI— end-to-end test covering:Spec references
Related PRs