Open nmiyake opened 3 months ago
artifactType
component of this issueannotations
component of this issueThis issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Keep fresh with the 'lifecycle/frozen' label.
Describe the bug
The OCI 1.1 specification for the "referrers" API states that, for the descriptors in the returned referrers index,
The descriptors MUST include an artifactType field that is set to the value of the artifactType in the image manifest or index, if present
andThe descriptors MUST include annotations from the image manifest or index.
.However, the current
go-containerregistry
library does not fulfill either of these requirements.To Reproduce
For annotations:
v1.Image
with a non-emptyannotations
field andsubject
field and useremote.Write
to write the imageremote.Referrers
on the subject and examine the manifest entryannotations
fieldFor
artifactType
:v1.Image
that specifies a value for theartifactType
field (can be done by including this field in the output of theRawManifest()
implementation ofv1.Image
) andsubject
field and useremote.Write
to write the imageremote.Referrers
on the subject and examine the manifest entryartifactType
field of the descriptor for the image from step 1 is set to the value ofConfig.MediaType
Expected behavior
For annotations:
annotations
field that matches theannotations
field of the imageFor
artifactType
:artifactType
value that matches thearitfactType
field of the imageAdditional context
Full text of the referrers specification:
GitHub has implemented an action that uses the referrers API to upload referrers using subjects, and it looks like their implementation properly does this (sets annotations and artifact types for referrer ImageIndex): https://github.com/actions/attest-build-provenance/issues/73#issuecomment-2111147467