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

Add reference field #828

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions descriptor.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ The following fields contain the primary properties that constitute a Descriptor
This OPTIONAL property contains arbitrary metadata for this descriptor.
This OPTIONAL property MUST use the [annotation rules](annotations.md#rules).

- **`reference`** *descriptor*

This OPTIONAL property contains a descriptor is the subject of the content described by this descriptor.
Copy link
Contributor

Choose a reason for hiding this comment

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

"which is the subject of"

This is used to associate multiple pieces of content.

Descriptors pointing to [`application/vnd.oci.image.manifest.v1+json`](manifest.md) SHOULD include the extended field `platform`, see [Image Index Property Descriptions](image-index.md#image-index-property-descriptions) for details.

### Reserved
Expand Down Expand Up @@ -176,6 +181,21 @@ In the following example, the descriptor indicates that the referenced manifest
}
```

In the following example, the descriptor indicates that the referenced manifest is retrievable from a particular URL:

```json
{
"mediaType": "application/vnd.example.signature+json",
"size": 3514,
"digest": "sha256:19387f68117dbe07daeef0d99e018f7bbf7a660158d24949ea47bc12a3e4ba17",
Copy link

Choose a reason for hiding this comment

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

this is the kind of place where multicodecs are useful https://github.com/multiformats/multicodec/blob/master/table.csv#L9

"reference": {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the use case of adding a reference to a descriptor? I understand it in the context of of a manifest or index object, but adding this field to the descriptor is creating lots of strange potential implementations where I'm not seeing the value add in present use cases. Is this being proposed in expectation of a descriptor as a manifest being approved, or are there other use cases?

"mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is a user supposed to read this as "this is the signature of the following manifest"? How would this work with "this is a list of SBoMs for the following manifest"? or "this is a list of signatures for the following manifest"?

"size": 1201,
"digest": "sha256:b4f9e18267eb98998f6130342baacaeb9553f136142d40959a1b46d6401f0f2b"
}
}
```

[rfc3986]: https://tools.ietf.org/html/rfc3986
[rfc4634-s4.1]: https://tools.ietf.org/html/rfc4634#section-4.1
[rfc4634-s4.2]: https://tools.ietf.org/html/rfc4634#section-4.2
Expand Down
5 changes: 5 additions & 0 deletions image-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ For the media type(s) that this document is compatible with, see the [matrix][ma

See [Pre-Defined Annotation Keys](annotations.md#pre-defined-annotation-keys).

- **`reference`** *descriptor*

This OPTIONAL property contains a [descriptor](descriptor.md) is the subject of the content described by this descriptor.
This is used to associate multiple pieces of content.

## Example Image Index

*Example showing a simple image index pointing to image manifests for two platforms:*
Expand Down
5 changes: 5 additions & 0 deletions manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ Unlike the [image index](image-index.md), which contains information about a set

See [Pre-Defined Annotation Keys](annotations.md#pre-defined-annotation-keys).

- **`reference`** *descriptor*
dlorenc marked this conversation as resolved.
Show resolved Hide resolved

This OPTIONAL property contains a [descriptor](descriptor.md) is the subject of the content described by this descriptor.
This is used to associate multiple pieces of content.

## Example Image Manifest

*Example showing an image manifest:*
Expand Down
3 changes: 3 additions & 0 deletions specs-go/v1/descriptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ type Descriptor struct {
//
// This should only be used when referring to a manifest.
Platform *Platform `json:"platform,omitempty"`

// Reference refers to the subject of this descriptor.
Reference *Descriptor `json:"reference,omitempty"`
}

// Platform describes the platform which the image in the manifest runs on.
Expand Down
3 changes: 3 additions & 0 deletions specs-go/v1/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ type Index struct {

// Annotations contains arbitrary metadata for the image index.
Annotations map[string]string `json:"annotations,omitempty"`

// Reference refers to the subject this image index.
Reference *Descriptor `json:"reference,omitempty"`
}
3 changes: 3 additions & 0 deletions specs-go/v1/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ type Manifest struct {

// Annotations contains arbitrary metadata for the image manifest.
Annotations map[string]string `json:"annotations,omitempty"`

// Reference refers to the subject this image manifest.
Reference *Descriptor `json:"reference,omitempty"`
}