-
Notifications
You must be signed in to change notification settings - Fork 226
Description
As long as referrers are fairly rarely used, when pulling an image, determining if there are any referrers requires an extra round-trip (if the registry is known to support the referrers API) or two (if the registry does not support the API and the referrers tag schema needs to be used).
Assuming there are registries where the implementation makes it cheap enough (I have no idea if that’s the case), it seems potentially valuable to allow a manifest pull request to include a header indicating referrers presence:
OCI-Referrers: present|absent
.
If this header is present:
- The registry MUST support the Listing Referrers endpoint
- The
present
/absent
value indicates whether there, at the time of forming the response, was at least one referrer.
A registry where determining the existence of referrers is costly could choose not to include the header; the client would then need to make an explicit “Listing Referrers” request.
I’m not sure about specifying the present
value, I don’t think it helps clients.
Alternatively, an OCI-Referrers-Artifact-Types
header listing the artifact types of all included referrers could eliminate even more roundtrips (for clients which e.g. only care about signatures and not SBOMs), at the cost of possibly being even costlier for registry to obtain.
It might even make sense to specify both.
If referrers use ever becomes very widespread, these headers would just add overhead, because clients would almost always want to list the referrers. In that case, registries could choose to stop including these headers.
I apologize if this was already discussed; I couldn’t find anything searching issues in this repo.