Skip to content

Commit 77efc6e

Browse files
committed
spec: clarify descriptor, align with de facto artifact usage
Signed-off-by: Aaron Friel <[email protected]>
1 parent 23d55d3 commit 77efc6e

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ Note: Any OPTIONAL field MAY also be set to null, which is equivalent to being a
248248
This field is used to mark if the history item created a filesystem diff.
249249
It is set to true if this history item doesn't correspond to an actual layer in the rootfs section (for example, Dockerfile's [ENV](https://docs.docker.com/engine/reference/builder/#/env) command results in no change to the filesystem).
250250

251-
Any extra fields in the Image JSON struct are considered implementation specific and MUST be ignored by any implementations which are unable to interpret them.
251+
Any extra fields in the Image JSON struct are considered implementation specific and MUST NOT generate an error by any implementations which are unable to interpret them.
252252

253253
Whitespace is OPTIONAL and implementations MAY have compact JSON with no whitespace.
254254

considerations.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
# Extensibility
22

3-
Implementations that are reading/processing [manifests](manifest.md) or [image indexes](image-index.md) MUST NOT generate an error if they encounter an unknown property.
4-
Instead they MUST ignore unknown properties.
3+
Implementations storing or copying content MUST NOT modify or alter the content in a way that would change the digest of the content. Examples of these implementations include:
4+
* A [registry implementing the distribution specification](https://github.com/opencontainers/distribution-spec/blob/main/spec.md#definitions), including local registries, caching proxies
5+
* An application which copies content to disk or between registries
6+
7+
Implementations processing content SHOULD NOT generate an error if they encounter an unknown property in a known media type. Examples of these implementations include:
8+
* A [runtime implementing the runtime specification](https://github.com/opencontainers/runtime-spec/blob/main/spec.md)
9+
* An implementation using OCI to retrieve and utilize artifacts, e.g.: a WASM runtime
510

611
# Canonicalization
712

image-index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ For the media type(s) that this document is compatible with, see the [matrix][ma
4242

4343
Image indexes concerned with portability SHOULD use one of the above media types.
4444
Future versions of the spec MAY use a different mediatype (i.e. a new versioned format).
45-
An encountered `mediaType` that is unknown to the implementation MUST be ignored.
45+
An encountered `mediaType` that is unknown to the implementation MUST NOT generate an error.
4646

4747
- **`platform`** *object*
4848

image-layout.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ This index provides an established path (`/index.json`) to have an entry point f
147147
* No semantic restriction is given for the "org.opencontainers.image.ref.name" annotation of descriptors.
148148
* In general the `mediaType` of each [descriptor][descriptors] object in the `manifests` field will be either `application/vnd.oci.image.index.v1+json` or `application/vnd.oci.image.manifest.v1+json`.
149149
* Future versions of the spec MAY use a different mediatype (i.e. a new versioned format).
150-
* An encountered `mediaType` that is unknown SHOULD be safely ignored.
150+
* An encountered `mediaType` that is unknown MUST NOT generate an error.
151151

152152

153153
**Implementor's Note:**

manifest.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Unlike the [image index](image-index.md), which contains information about a set
3131
This OPTIONAL property contains the type of an artifact when the manifest is used for an artifact.
3232
This MUST be set when `config.mediaType` is set to the [scratch value](#example-of-a-scratch-config-or-layer-descriptor).
3333
If defined, the value MUST comply with [RFC 6838][rfc6838], including the [naming requirements in its section 4.2][rfc6838-s4.2], and MAY be registered with [IANA][iana].
34+
Implementations storing or copying image manifests MUST NOT error on encountering an `artifactType` that is unknown to the implementation.
3435

3536
- **`config`** *[descriptor](descriptor.md)*
3637

@@ -40,6 +41,9 @@ Unlike the [image index](image-index.md), which contains information about a set
4041
- **`mediaType`** *string*
4142

4243
This [descriptor property](descriptor.md#properties) has additional restrictions for `config`.
44+
45+
Implementations MUST NOT attempt to parse the referenced content if this media type is unknown and instead consider the referenced content as arbitrary binary data (e.g.: as `application/octet-stream`).
46+
4347
Implementations MUST support at least the following media types:
4448

4549
- [`application/vnd.oci.image.config.v1+json`](config.md)
@@ -83,7 +87,7 @@ Unlike the [image index](image-index.md), which contains information about a set
8387
- [`application/vnd.oci.image.layer.nondistributable.v1.tar+gzip`](layer.md#gzip-media-types)
8488

8589
Manifests concerned with portability SHOULD use one of the above media types.
86-
An encountered `mediaType` that is unknown to the implementation MUST be ignored.
90+
Implementations storing or copying image manifests MUST NOT error on encountering a `mediaType` that is unknown to the implementation.
8791

8892
Entries in this field will frequently use the `+gzip` types.
8993

0 commit comments

Comments
 (0)