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

question: Can the remote.Referrers function be updated to handle a 406 response when attempting a request against the referrers API endpoint? #1962

Open
malancas opened this issue Jun 18, 2024 · 1 comment
Labels
question Further information is requested

Comments

@malancas
Copy link

When the remote.Referrers function fetches a list of referrers for a manifest, it first attempts to make a request to the referrers API endpoint. If that fails, it falls back to making a request to the manifests endpoint using the referrers tag schema.

While using this function with a registry that does not support the referrers API endpoint, I found the function was unexpectedly failing. Digging into the error, I found the registry was returning a 406 instead of a 404 when the function attempted to make a request to the referrers endpoint. Adding http.StatusNotAcceptable to the list of handled status codes in transport.CheckError here fixed the problem for me.

Would it be possible to add http.StatusNotAcceptable to the list of status codes handled by transport.CheckError? Since it is a 4XX error, the Referrers is able to fallback and try the manifests API endpoint.

@malancas malancas added the question Further information is requested label Jun 18, 2024
@GregoireW
Copy link
Contributor

FYI

I put this here, even though it is related but not really...

Playing with the new GitHub attestation api and modified sigstore policy controller, I got an issue with Google Artifact Registry when retrieving the referrers. (OCI 1.0, but redirect to authentication page when referrer api call is made, so response is 200 + content text/html)

As the spec is clear the content type must be application/vnd.oci.image.index.v1+json I created a PR #1968

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants