Skip to content
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

Feature request: Adding repo.ReferrersCapability() in oras-go #423

Closed
patrickzheng200 opened this issue Jan 31, 2023 · 6 comments
Closed
Assignees
Labels
enhancement New feature or request experimental Issues or pull requests depending on WIP specs question Further information is requested
Milestone

Comments

@patrickzheng200
Copy link
Contributor

As a user, I'd like to check if a remote registry supports the Referrers API. Currently, I need the following code to do so:

const zeroDigest = "sha256:0000000000000000000000000000000000000000000000000000000000000000"
if err := remoteRepo.SetReferrersCapability(true); err != nil {
	return nil, err
}
var checkReferrerDesc ocispec.Descriptor
checkReferrerDesc.Digest = zeroDigest
err := remoteRepo.Referrers(ctx, checkReferrerDesc, "", func(referrers []ocispec.Descriptor) error {
	return nil
})
if err != nil {
	return nil, fmt.Errorf("failed to ping Referrers API with error: %v", err)
}

the remoteRepo.Referrers is an overhead. Applications that want this check need to have something similar, so probably adding a repo.ReferrersCapability() feature in oras-go might save resources for users?

@Wwwsylvia
Copy link
Member

We may export pingReferrers() if there is a need.

@shizhMSFT
Copy link
Contributor

Since there are multiple solutions / options, why not start a discussion on the design?

@shizhMSFT
Copy link
Contributor

shizhMSFT commented Feb 1, 2023

We may export pingReferrers() if there is a need.

Exporting pingReferrers() is a good candidate as we already have an API named Ping().

@shizhMSFT shizhMSFT added the enhancement New feature or request label Feb 1, 2023
@shizhMSFT shizhMSFT added this to the v2.1.0 milestone Feb 1, 2023
@patrickzheng200
Copy link
Contributor Author

We may export pingReferrers() if there is a need.

Yeah, exporting pingReferrers() would simplify the above logic to a 1-line code since it also sets the repo's referrersState.

@shizhMSFT shizhMSFT added question Further information is requested experimental Issues or pull requests depending on WIP specs labels Mar 22, 2023
@shizhMSFT shizhMSFT modified the milestones: v2.1.0, v2.2.0 May 4, 2023
@Wwwsylvia Wwwsylvia modified the milestones: v2.2.0, v2.3.0 May 24, 2023
@Wwwsylvia

This comment was marked as duplicate.

@Wwwsylvia
Copy link
Member

This feature was requested for notation to determine which manifest type to pack (OCI Artifact Manifest or OCI Image Manifest).
Given that OCI Artifact Manifest has been deprecated since image-spec v1.1.0-rc4 (See #494), this scenario is not valid anymore.
Hence, we can close this issue for now.
Please reopen it if the feature is still needed.

@Wwwsylvia Wwwsylvia closed this as not planned Won't fix, can't repro, duplicate, stale Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request experimental Issues or pull requests depending on WIP specs question Further information is requested
Projects
Status: No status
Status: Todo
Development

No branches or pull requests

3 participants