Skip to content

Commit 80d4234

Browse files
authored
Add artifactType to descriptor (#11)
Signed-off-by: Sajay Antony <[email protected]>
1 parent 1c4ad9a commit 80d4234

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

artifact.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ For the media type(s) that this is compatible with see the [matrix](media-types.
1515

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

18+
- **`artifactType`** *string*
19+
20+
This property SHOULD specify the mediaType of the referenced content and MAY be registered with [IANA][iana].
21+
1822
- **`blobs`** *string*
1923

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

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

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

@@ -56,6 +60,7 @@ For the media type(s) that this is compatible with see the [matrix](media-types.
5660
{
5761
"schemaVersion": 2,
5862
"mediaType": "application/vnd.oci.artifact.manifest.v1+json",
63+
"artifactType" "application/example"
5964
"blobs": [
6065
{
6166
"mediaType": "application/vnd.icecream.flavor",
@@ -74,3 +79,6 @@ For the media type(s) that this is compatible with see the [matrix](media-types.
7479
]
7580
}
7681
```
82+
83+
[iana]: https://www.iana.org/assignments/media-types/media-types.xhtml
84+
[rfc-3339]: https://tools.ietf.org/html/rfc3339#section-5.6

descriptor.md

+7
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,14 @@ The following fields contain the primary properties that constitute a Descriptor
5656
The decoded data MUST be identical to the referenced content and SHOULD be verified against the [`digest`](#digests) and `size` fields by content consumers.
5757
See [Embedded Content](#embedded-content) for when this is appropriate.
5858

59+
- **`artifactType`** *string*
60+
61+
This OPTIONAL property contains the [IANA][iana] mediaType of the object when the descriptor is pointing to an [artifact manifest](artifact.md).
62+
5963
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.
6064

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

6369
Extended _Descriptor_ field additions proposed in other OCI specifications SHOULD first be considered for addition into this specification.
@@ -216,3 +222,4 @@ In the following example, the descriptor indicates the type of artifact it is re
216222
[rfc6838-s4.2]: https://tools.ietf.org/html/rfc6838#section-4.2
217223
[rfc7230-s2.7]: https://tools.ietf.org/html/rfc7230#section-2.7
218224
[sha256-vs-sha512]: https://groups.google.com/a/opencontainers.org/forum/#!topic/dev/hsMw7cAwrZE
225+
[iana]: https://www.iana.org/assignments/media-types/media-types.xhtml

media-types.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The following media types identify the formats described here and their referenc
1313
- `application/vnd.oci.image.layer.nondistributable.v1.tar`: ["Layer", as a tar archive with distribution restrictions](layer.md#non-distributable-layers)
1414
- `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]
1515
- `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]
16+
- `application/vnd.oci.artifact.manifest.v1+json`: [Artifact manifest](artifact.md)
1617

1718
## Media Type Conflicts
1819

specs-go/v1/descriptor.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ type Descriptor struct {
2929
// Size specifies the size in bytes of the blob.
3030
Size int64 `json:"size"`
3131

32-
// ArtifactType is the type of artifact this schema refers to.
33-
ArtifactType string `json:"artifactType,omitempty"`
34-
3532
// URLs specifies a list of URLs from which this object MAY be downloaded
3633
URLs []string `json:"urls,omitempty"`
3734

@@ -47,6 +44,9 @@ type Descriptor struct {
4744
//
4845
// This should only be used when referring to a manifest.
4946
Platform *Platform `json:"platform,omitempty"`
47+
48+
// ArtifactType is the IANA media type of this artifact.
49+
ArtifactType string `json:"artifactType,omitempty"`
5050
}
5151

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

0 commit comments

Comments
 (0)