From 2eb4046685179aa5392bd938a21a20cd721fc133 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 27 Oct 2021 16:15:35 -0400 Subject: [PATCH 1/5] *.md: bring mediaType out of reserved status Signed-off-by: Vincent Batts --- image-index.md | 5 +++-- manifest.md | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/image-index.md b/image-index.md index 6acb0120a..c8e6e561a 100644 --- a/image-index.md +++ b/image-index.md @@ -18,8 +18,9 @@ For the media type(s) that this document is compatible with, see the [matrix][ma - **`mediaType`** *string* - This property is *reserved* for use, to [maintain compatibility][matrix]. - When used, this field contains the media type of this document, which differs from the [descriptor](descriptor.md#properties) use of `mediaType`. + This property SHOULD be used and [remain compatible][matrix] with earlier versions of this specification and with other similar external formats. + When used, this field MUST contain the media type `application/vnd.oci.image.index.v1+json`. + This field usage differs from the [descriptor](descriptor.md#properties) use of `mediaType`. - **`manifests`** *array of objects* diff --git a/manifest.md b/manifest.md index da3b675d7..9cb833afd 100644 --- a/manifest.md +++ b/manifest.md @@ -22,8 +22,9 @@ Unlike the [image index](image-index.md), which contains information about a set - **`mediaType`** *string* - This property is *reserved* for use, to [maintain compatibility](media-types.md#compatibility-matrix). - When used, this field contains the media type of this document, which differs from the [descriptor](descriptor.md#properties) use of `mediaType`. + This property SHOULD be used and [remain compatible](media-types.md#compatibility-matrix) with earlier versions of this specification and with other similar external formats. + When used, this field MUST contain the media type `application/vnd.oci.image.manifest.v1+json`. + This field usage differs from the [descriptor](descriptor.md#properties) use of `mediaType`. - **`config`** *[descriptor](descriptor.md)* @@ -62,7 +63,6 @@ Unlike the [image index](image-index.md), which contains information about a set Manifests concerned with portability SHOULD use one of the above media types. An encountered `mediaType` that is unknown to the implementation MUST be ignored. - Entries in this field will frequently use the `+gzip` types. - **`annotations`** *string-string map* From 5b82148fa647734a2c6095b2eab9b502fbca227e Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 3 Nov 2021 14:26:23 -0400 Subject: [PATCH 2/5] specs-go: adding `mediaType` to the index and manifest structures Signed-off-by: Vincent Batts --- specs-go/v1/index.go | 3 +++ specs-go/v1/manifest.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/specs-go/v1/index.go b/specs-go/v1/index.go index 4e6c4b236..82da6c6a8 100644 --- a/specs-go/v1/index.go +++ b/specs-go/v1/index.go @@ -21,6 +21,9 @@ import "github.com/opencontainers/image-spec/specs-go" type Index struct { specs.Versioned + // MediaType specificies the type of this document data structure e.g. `application/vnd.oci.image.index.v1+json` + MediaType string `json:"mediaType,omitempty"` + // Manifests references platform specific manifests. Manifests []Descriptor `json:"manifests"` diff --git a/specs-go/v1/manifest.go b/specs-go/v1/manifest.go index 7ff32c40b..d72d15ce4 100644 --- a/specs-go/v1/manifest.go +++ b/specs-go/v1/manifest.go @@ -20,6 +20,9 @@ import "github.com/opencontainers/image-spec/specs-go" type Manifest struct { specs.Versioned + // MediaType specificies the type of this document data structure e.g. `application/vnd.oci.image.manifest.v1+json` + MediaType string `json:"mediaType,omitempty"` + // Config references a configuration object for a container, by digest. // The referenced configuration object is a JSON blob that the runtime uses to set up the container. Config Descriptor `json:"config"` From beccafda54bfd323796d02c1e410fd201f9a1f32 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 9 Nov 2021 12:04:38 -0500 Subject: [PATCH 3/5] version: release 1.0.2 Signed-off-by: Vincent Batts --- specs-go/version.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs-go/version.go b/specs-go/version.go index 58f1095ab..0d9543f16 100644 --- a/specs-go/version.go +++ b/specs-go/version.go @@ -22,10 +22,10 @@ const ( // VersionMinor is for functionality in a backwards-compatible manner VersionMinor = 0 // VersionPatch is for backwards-compatible bug fixes - VersionPatch = 1 + VersionPatch = 2 // VersionDev indicates development branch. Releases will be empty string. - VersionDev = "-dev" + VersionDev = "" ) // Version is the specification version that the package types support. From 3be64d91682a82cb5758392866da0dd38cd0b379 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 9 Nov 2021 12:04:57 -0500 Subject: [PATCH 4/5] version: bump main back to -dev Signed-off-by: Vincent Batts --- specs-go/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs-go/version.go b/specs-go/version.go index 0d9543f16..31f99cf64 100644 --- a/specs-go/version.go +++ b/specs-go/version.go @@ -25,7 +25,7 @@ const ( VersionPatch = 2 // VersionDev indicates development branch. Releases will be empty string. - VersionDev = "" + VersionDev = "-dev" ) // Version is the specification version that the package types support. From 6ced3bd57837c4b46f316fe3c2e28d2a1169e031 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 28 Oct 2021 14:05:29 -0400 Subject: [PATCH 5/5] media-types: `.mediaType` is available in both OCI and Docker Signed-off-by: Vincent Batts --- media-types.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/media-types.md b/media-types.md index c41a4a73f..aa0b464b3 100644 --- a/media-types.md +++ b/media-types.md @@ -39,7 +39,6 @@ This section shows where the OCI Image Specification is compatible with formats **Similar/related schema** - [application/vnd.docker.distribution.manifest.list.v2+json](https://github.com/distribution/distribution/blob/master/docs/spec/manifest-v2-2.md#manifest-list) - - `.mediaType`: only present in Docker, and reserved in OCI - `.annotations`: only present in OCI - `.[]manifests.annotations`: only present in OCI - `.[]manifests.urls`: only present in OCI @@ -49,7 +48,6 @@ This section shows where the OCI Image Specification is compatible with formats **Similar/related schema** - [application/vnd.docker.distribution.manifest.v2+json](https://github.com/distribution/distribution/blob/master/docs/spec/manifest-v2-2.md#image-manifest-field-descriptions) - - `.mediaType`: only present in Docker, and reserved in OCI - `.annotations`: only present in OCI - `.config.annotations`: only present in OCI - `.config.urls`: only present in OCI