Skip to content

Commit

Permalink
Merge pull request from GHSA-77vh-xpmg-72qh
Browse files Browse the repository at this point in the history
*.md: bring mediaType out of reserved status
  • Loading branch information
vbatts authored Nov 17, 2021
2 parents 9a7a987 + 6ced3bd commit 693428a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
5 changes: 3 additions & 2 deletions image-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand Down
6 changes: 3 additions & 3 deletions manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)*

Expand Down Expand Up @@ -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*
Expand Down
2 changes: 0 additions & 2 deletions media-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
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 @@ -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"`

Expand Down
3 changes: 3 additions & 0 deletions specs-go/v1/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
2 changes: 1 addition & 1 deletion specs-go/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ 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"
Expand Down

0 comments on commit 693428a

Please sign in to comment.