Skip to content

Commit

Permalink
Add artifactType to descriptor (#11)
Browse files Browse the repository at this point in the history
Signed-off-by: Sajay Antony <sajaya@microsoft.com>
  • Loading branch information
sajayantony authored Aug 9, 2022
1 parent 1c4ad9a commit 80d4234
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
10 changes: 9 additions & 1 deletion artifact.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ For the media type(s) that this is compatible with see the [matrix](media-types.

This property MUST be used and contain the media type `application/vnd.oci.artifact.manifest.v1+json`.

- **`artifactType`** *string*

This property SHOULD specify the mediaType of the referenced content and MAY be registered with [IANA][iana].

- **`blobs`** *string*

This OPTIONAL property contains a list of [descriptors](descriptor.md).
Expand All @@ -35,7 +39,7 @@ For the media type(s) that this is compatible with see the [matrix](media-types.
The following annotations MAY be used:

- `org.opencontainers.artifact.description`: human readable description for the artifact
- `org.opencontainers.artifact.created`: creation time of the artifact
- `org.opencontainers.artifact.created`: creation time of the artifact expressed as string defined by [RFC 3339][rfc-3339]

Additionally, the following annotations SHOULD be used when deploying multi-arch container images:

Expand All @@ -56,6 +60,7 @@ For the media type(s) that this is compatible with see the [matrix](media-types.
{
"schemaVersion": 2,
"mediaType": "application/vnd.oci.artifact.manifest.v1+json",
"artifactType" "application/example"
"blobs": [
{
"mediaType": "application/vnd.icecream.flavor",
Expand All @@ -74,3 +79,6 @@ For the media type(s) that this is compatible with see the [matrix](media-types.
]
}
```

[iana]: https://www.iana.org/assignments/media-types/media-types.xhtml
[rfc-3339]: https://tools.ietf.org/html/rfc3339#section-5.6
7 changes: 7 additions & 0 deletions descriptor.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,14 @@ The following fields contain the primary properties that constitute a Descriptor
The decoded data MUST be identical to the referenced content and SHOULD be verified against the [`digest`](#digests) and `size` fields by content consumers.
See [Embedded Content](#embedded-content) for when this is appropriate.

- **`artifactType`** *string*

This OPTIONAL property contains the [IANA][iana] mediaType of the object when the descriptor is pointing to an [artifact manifest](artifact.md).

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.

Descriptors pointing to [`application/vnd.oci.artifact.manifest.v1+json`](artifact.md) SHOULD include the extended field `artifactType`.

### Reserved

Extended _Descriptor_ field additions proposed in other OCI specifications SHOULD first be considered for addition into this specification.
Expand Down Expand Up @@ -216,3 +222,4 @@ In the following example, the descriptor indicates the type of artifact it is re
[rfc6838-s4.2]: https://tools.ietf.org/html/rfc6838#section-4.2
[rfc7230-s2.7]: https://tools.ietf.org/html/rfc7230#section-2.7
[sha256-vs-sha512]: https://groups.google.com/a/opencontainers.org/forum/#!topic/dev/hsMw7cAwrZE
[iana]: https://www.iana.org/assignments/media-types/media-types.xhtml
1 change: 1 addition & 0 deletions media-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The following media types identify the formats described here and their referenc
- `application/vnd.oci.image.layer.nondistributable.v1.tar`: ["Layer", as a tar archive with distribution restrictions](layer.md#non-distributable-layers)
- `application/vnd.oci.image.layer.nondistributable.v1.tar+gzip`: ["Layer", as a tar archive with distribution restrictions](layer.md#gzip-media-types) compressed with [gzip][rfc1952]
- `application/vnd.oci.image.layer.nondistributable.v1.tar+zstd`: ["Layer", as a tar archive with distribution restrictions](layer.md#zstd-media-types) compressed with [zstd][rfc8478]
- `application/vnd.oci.artifact.manifest.v1+json`: [Artifact manifest](artifact.md)

## Media Type Conflicts

Expand Down
6 changes: 3 additions & 3 deletions specs-go/v1/descriptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ type Descriptor struct {
// Size specifies the size in bytes of the blob.
Size int64 `json:"size"`

// ArtifactType is the type of artifact this schema refers to.
ArtifactType string `json:"artifactType,omitempty"`

// URLs specifies a list of URLs from which this object MAY be downloaded
URLs []string `json:"urls,omitempty"`

Expand All @@ -47,6 +44,9 @@ type Descriptor struct {
//
// This should only be used when referring to a manifest.
Platform *Platform `json:"platform,omitempty"`

// ArtifactType is the IANA media type of this artifact.
ArtifactType string `json:"artifactType,omitempty"`
}

// Platform describes the platform which the image in the manifest runs on.
Expand Down

0 comments on commit 80d4234

Please sign in to comment.