Skip to content
This repository was archived by the owner on Apr 29, 2024. It is now read-only.

Add reference types support to distribution. #1

Merged
merged 1 commit into from
May 11, 2022

Conversation

sajayantony
Copy link

@sajayantony sajayantony commented May 7, 2022

  • Make and run the registry with the sample config in the repo
./bin/registry serve cmd/registry/config-example-with-extensions.yml
  • You can view the manifests using a test extension
➜ http -b :5000/v2/reftype-test/_distribution/registry/manifests
{
    "digests": [
        "sha256:28ffe613ed468b4aa3b60061f529ef676144d47bfc7067bd465d58e370f07718",
        "sha256:65b3a80ebe7471beecbc090c5b2cdd0aafeaefa0715f8f12e40dc918a3a70e32"
    ],
    "name": "reftype-test"
}

In the above, digest 65b3a80 is an image and 28ffe6 refers to that image. You can query the first digest for things that refer to it.

➜ http -b 'localhost:5000/v2/reftype-test/_oci/artifacts/referrers?digest=sha256:65b3a80ebe7471beecbc090c5b2cdd0aafeaefa0715f8f12e40dc918a3a70e32'
{
    "manifests": [
        {
            "digest": "sha256:28ffe613ed468b4aa3b60061f529ef676144d47bfc7067bd465d58e370f07718",
            "mediaType": "application/vnd.oci.artifact.manifest.v1+json",
            "size": 491
        }
    ],
    "schemaVersion": 2
}
  • Here is the manifest for the artifact using the artifact manifest defined -

https://github.com/oci-playground/artifact-spec/blob/8fed0a29d06fc27c88c787722707af59499c30b5/specs-go/v1/artifact.go#L21-L33

image

Co-authored-by: Tejaswini Duggaraju <[email protected]>
Co-authored-by: Akash Singhal <[email protected]>
Co-authored-by: Aviral Takkar <[email protected]>
Co-authored-by: Julus Liu <[email protected]>
Signed-off-by: Sajay Antony <[email protected]>
Copy link

@jdolitsky jdolitsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about how this compares to Proposal E as it stands, for example /referrers vs /references, but I'm in favor of getting things merged quickly into this fork

@sajayantony
Copy link
Author

Good catch @jdolitsky - I'm ok merging and updating as well since the names will change here -
opencontainers/wg-reference-types#44

@jdolitsky
Copy link

See also #2
Would be great to get the demo steps from the PR description directly in the README here

@sajayantony sajayantony marked this pull request as ready for review May 11, 2022 18:42
@sajayantony sajayantony merged commit cef53f2 into oci-playground:main May 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants