Skip to content

Commit 693428a

Browse files
authored
Merge pull request from GHSA-77vh-xpmg-72qh
*.md: bring mediaType out of reserved status
2 parents 9a7a987 + 6ced3bd commit 693428a

File tree

6 files changed

+13
-8
lines changed

6 files changed

+13
-8
lines changed

image-index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ For the media type(s) that this document is compatible with, see the [matrix][ma
1818

1919
- **`mediaType`** *string*
2020

21-
This property is *reserved* for use, to [maintain compatibility][matrix].
22-
When used, this field contains the media type of this document, which differs from the [descriptor](descriptor.md#properties) use of `mediaType`.
21+
This property SHOULD be used and [remain compatible][matrix] with earlier versions of this specification and with other similar external formats.
22+
When used, this field MUST contain the media type `application/vnd.oci.image.index.v1+json`.
23+
This field usage differs from the [descriptor](descriptor.md#properties) use of `mediaType`.
2324

2425
- **`manifests`** *array of objects*
2526

manifest.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ Unlike the [image index](image-index.md), which contains information about a set
2222

2323
- **`mediaType`** *string*
2424

25-
This property is *reserved* for use, to [maintain compatibility](media-types.md#compatibility-matrix).
26-
When used, this field contains the media type of this document, which differs from the [descriptor](descriptor.md#properties) use of `mediaType`.
25+
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.
26+
When used, this field MUST contain the media type `application/vnd.oci.image.manifest.v1+json`.
27+
This field usage differs from the [descriptor](descriptor.md#properties) use of `mediaType`.
2728

2829
- **`config`** *[descriptor](descriptor.md)*
2930

@@ -62,7 +63,6 @@ Unlike the [image index](image-index.md), which contains information about a set
6263
Manifests concerned with portability SHOULD use one of the above media types.
6364
An encountered `mediaType` that is unknown to the implementation MUST be ignored.
6465

65-
6666
Entries in this field will frequently use the `+gzip` types.
6767

6868
- **`annotations`** *string-string map*

media-types.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ This section shows where the OCI Image Specification is compatible with formats
3939
**Similar/related schema**
4040

4141
- [application/vnd.docker.distribution.manifest.list.v2+json](https://github.com/distribution/distribution/blob/master/docs/spec/manifest-v2-2.md#manifest-list)
42-
- `.mediaType`: only present in Docker, and reserved in OCI
4342
- `.annotations`: only present in OCI
4443
- `.[]manifests.annotations`: only present in OCI
4544
- `.[]manifests.urls`: only present in OCI
@@ -49,7 +48,6 @@ This section shows where the OCI Image Specification is compatible with formats
4948
**Similar/related schema**
5049

5150
- [application/vnd.docker.distribution.manifest.v2+json](https://github.com/distribution/distribution/blob/master/docs/spec/manifest-v2-2.md#image-manifest-field-descriptions)
52-
- `.mediaType`: only present in Docker, and reserved in OCI
5351
- `.annotations`: only present in OCI
5452
- `.config.annotations`: only present in OCI
5553
- `.config.urls`: only present in OCI

specs-go/v1/index.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import "github.com/opencontainers/image-spec/specs-go"
2121
type Index struct {
2222
specs.Versioned
2323

24+
// MediaType specificies the type of this document data structure e.g. `application/vnd.oci.image.index.v1+json`
25+
MediaType string `json:"mediaType,omitempty"`
26+
2427
// Manifests references platform specific manifests.
2528
Manifests []Descriptor `json:"manifests"`
2629

specs-go/v1/manifest.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ import "github.com/opencontainers/image-spec/specs-go"
2020
type Manifest struct {
2121
specs.Versioned
2222

23+
// MediaType specificies the type of this document data structure e.g. `application/vnd.oci.image.manifest.v1+json`
24+
MediaType string `json:"mediaType,omitempty"`
25+
2326
// Config references a configuration object for a container, by digest.
2427
// The referenced configuration object is a JSON blob that the runtime uses to set up the container.
2528
Config Descriptor `json:"config"`

specs-go/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const (
2222
// VersionMinor is for functionality in a backwards-compatible manner
2323
VersionMinor = 0
2424
// VersionPatch is for backwards-compatible bug fixes
25-
VersionPatch = 1
25+
VersionPatch = 2
2626

2727
// VersionDev indicates development branch. Releases will be empty string.
2828
VersionDev = "-dev"

0 commit comments

Comments
 (0)