Skip to content

Commit f58ea21

Browse files
authored
Merge pull request opencontainers#347 from wking/versioned-media-types
Consistently version media types
2 parents cc6f95e + 4e31348 commit f58ea21

File tree

13 files changed

+25
-25
lines changed

13 files changed

+25
-25
lines changed

config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Changing it means creating a new derived image, instead of changing the existing
2626
A layer DiffID is a SHA256 digest over the layer's uncompressed tar archive and serialized in the descriptor digest format, e.g., `sha256:a9561eb1b190625c9adb5a9513e72c4dedafc1cb2d4c5236c9a6957ec7dfd5a9`.
2727
Layers must be packed and unpacked reproducibly to avoid changing the layer DiffID, for example by using tar-split to save the tar headers.
2828

29-
NOTE: the DiffID is different than the digest in the manifest list because the manifest digest is taken over the gzipped layer for `application/vnd.oci.image.layer.tar+gzip` types.
29+
NOTE: the DiffID is different than the digest in the manifest list because the manifest digest is taken over the gzipped layer for `application/vnd.oci.image.layer.v1.tar+gzip` types.
3030

3131
### Layer ChainID
3232

image-layout.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ $ cat ./blobs/sha256/afff3924849e458c5ef237db5f89539274d5e609db5db935ed3959c90f1
9696
},
9797
"layers": [
9898
{
99-
"mediaType": "application/vnd.oci.image.layer.tar+gzip",
99+
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
100100
"size": 32654,
101101
"digest": "sha256:e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7fc331f"
102102
},

image/manifest_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func TestUnpackLayer(t *testing.T) {
108108

109109
testManifest := manifest{
110110
Layers: []descriptor{descriptor{
111-
MediaType: "application/vnd.oci.image.layer.tar+gzip",
111+
MediaType: "application/vnd.oci.image.layer.v1.tar+gzip",
112112
Digest: fmt.Sprintf("sha256:%s", fmt.Sprintf("%x", h.Sum(nil))),
113113
}},
114114
}

img/media-types.dot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ digraph G {
33
manifestList [shape=note, label="Manifest list\n<<optional>>\napplication/vnd.oci.image.manifest.list.v1+json"]
44
manifest [shape=note, label="Image manifest\napplication/vnd.oci.image.manifest.v1+json"]
55
config [shape=note, label="Image JSON\napplication/vnd.oci.image.config.v1+json"]
6-
layer [shape=note, label="Layer tar+gzip\napplication/vnd.oci.image.layer.tar+gzip\napplication/vnd.oci.image.layer.nondistributable.tar+gzip"]
6+
layer [shape=note, label="Layer tar+gzip\napplication/vnd.oci.image.layer.v1.tar+gzip\napplication/vnd.oci.image.layer.nondistributable.v1.tar+gzip"]
77
}
88

99
manifestList -> manifest [label="1..*"]

img/media-types.png

-174 Bytes
Loading

layer.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ This document will use a concrete example to illustrate how to create and consum
66

77
## Distributable Format
88

9-
Layer Changesets for the [mediatype](./media-types.md) `application/vnd.oci.image.layer.tar+gzip` MUST be packaged in a [tar archive][tar-archive] compressed with [gzip][gzip].
10-
Layer Changesets for the [mediatype](./media-types.md) `application/vnd.oci.image.layer.tar+gzip` MUST NOT include duplicate entries for file paths in the resulting [tar archive][tar-archive].
9+
Layer Changesets for the [mediatype](./media-types.md) `application/vnd.oci.image.layer.v1.tar+gzip` MUST be packaged in a [tar archive][tar-archive] compressed with [gzip][gzip].
10+
Layer Changesets for the [mediatype](./media-types.md) `application/vnd.oci.image.layer.v1.tar+gzip` MUST NOT include duplicate entries for file paths in the resulting [tar archive][tar-archive].
1111

1212
## Change Types
1313

@@ -206,7 +206,7 @@ Where the basename name of `./etc/my-app-config` is now prefixed with `.wh.`, an
206206

207207
## Applying
208208

209-
Layer Changesets of [mediatype](./media-types.md) `application/vnd.oci.image.layer.tar+gzip` are applied rather than strictly extracted in normal fashion for tar archives.
209+
Layer Changesets of [mediatype](./media-types.md) `application/vnd.oci.image.layer.v1.tar+gzip` are applied rather than strictly extracted in normal fashion for tar archives.
210210

211211
Applying a layer changeset requires consideration for the [whiteout](#whiteouts) files.
212212
In the absence of any [whiteout](#whiteouts) files in a layer changeset, the archive is extracted like a regular tar archive.
@@ -311,7 +311,7 @@ Any given image is likely to be composed of several of these Image Filesystem Ch
311311
Certain layers, due to legal requirements, may not be regularly distributable.
312312
Typically, such layers are downloaded directly from a distributor but are never uploaded.
313313

314-
Layers that have these restrictions SHOULD be tagged with an alternative mediatype of `application/vnd.oci.image.layer.nondistributable.tar+gzip`.
314+
Layers that have these restrictions SHOULD be tagged with an alternative mediatype of `application/vnd.oci.image.layer.nondistributable.v1.tar+gzip`.
315315
[Descriptors](descriptor.md) referencing these layers MAY include `urls` for downloading these layers.
316316
It is implementation-defined whether or not implementations upload layers tagged with this media type.
317317

manifest.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ Unlike the [Manifest List](#manifest-list), which contains information about a s
169169
This [descriptor property](descriptor.md#properties) has additional restrictions for `layers[]`.
170170
Implementations MUST support at least the following media types:
171171

172-
- [`application/vnd.oci.image.layer.tar+gzip`](layer.md)
173-
- [`application/vnd.oci.image.layer.nondistributable.tar+gzip`](layer.md#non-distributable-layers)
172+
- [`application/vnd.oci.image.layer.v1.tar+gzip`](layer.md)
173+
- [`application/vnd.oci.image.layer.nondistributable.v1.tar+gzip`](layer.md#non-distributable-layers)
174174

175175
Manifests concerned with portability SHOULD use one of the above media types.
176176

@@ -205,17 +205,17 @@ Instead they MUST ignore unknown properties.
205205
},
206206
"layers": [
207207
{
208-
"mediaType": "application/vnd.oci.image.layer.tar+gzip",
208+
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
209209
"size": 32654,
210210
"digest": "sha256:e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7fc331f"
211211
},
212212
{
213-
"mediaType": "application/vnd.oci.image.layer.tar+gzip",
213+
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
214214
"size": 16724,
215215
"digest": "sha256:3c3a4604a545cdc127456d94e421cd355bca5b528f4a9c1905b15da2eb4a4c6b"
216216
},
217217
{
218-
"mediaType": "application/vnd.oci.image.layer.tar+gzip",
218+
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
219219
"size": 73109,
220220
"digest": "sha256:ec4b8955958665577945c89419d1af06b5f7636b4ac3da7f12184802ad867736"
221221
}

media-types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ The following media types identify the formats described here and their referenc
66
- `application/vnd.oci.image.manifest.list.v1+json`: [Manifest list](manifest.md#manifest-list)
77
- `application/vnd.oci.image.manifest.v1+json`: [Image manifest format](manifest.md#image-manifest)
88
- `application/vnd.oci.image.config.v1+json`: [Image config JSON](config.md)
9-
- `application/vnd.oci.image.layer.tar+gzip`: ["Layer", as a gzipped tar archive](layer.md)
10-
- `application/vnd.oci.image.layer.nondistributable.tar+gzip`: ["Layer", as a gzipped tar archive with distribution restrictions](layer.md#non-distributable-layers)
9+
- `application/vnd.oci.image.layer.v1.tar+gzip`: ["Layer", as a gzipped tar archive](layer.md)
10+
- `application/vnd.oci.image.layer.nondistributable.v1.tar+gzip`: ["Layer", as a gzipped tar archive with distribution restrictions](layer.md#non-distributable-layers)
1111

1212
## Compatibility Matrix
1313

schema/manifest_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func TestManifest(t *testing.T) {
6767
},
6868
"layers": [
6969
{
70-
"mediaType": "application/vnd.oci.image.layer.tar+gzip",
70+
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
7171
"size": "675598",
7272
"digest": "sha256:c86f7763873b6c0aae22d963bab59b4f5debbed6685761b5951584f6efb0633b"
7373
}
@@ -90,17 +90,17 @@ func TestManifest(t *testing.T) {
9090
},
9191
"layers": [
9292
{
93-
"mediaType": "application/vnd.oci.image.layer.tar+gzip",
93+
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
9494
"size": 675598,
9595
"digest": "sha256:9d3dd9504c685a304985025df4ed0283e47ac9ffa9bd0326fddf4d59513f0827"
9696
},
9797
{
98-
"mediaType": "application/vnd.oci.image.layer.tar+gzip",
98+
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
9999
"size": 156,
100100
"digest": "sha256:2b689805fbd00b2db1df73fae47562faac1a626d5f61744bfe29946ecff5d73d"
101101
},
102102
{
103-
"mediaType": "application/vnd.oci.image.layer.tar+gzip",
103+
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
104104
"size": 148,
105105
"digest": "sha256:c57089565e894899735d458f0fd4bb17a0f1e0df8d72da392b85c9b35ee777cd"
106106
}

specs-go/descriptor.go renamed to specs-go/v1/descriptor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package specs
15+
package v1
1616

1717
// Descriptor describes the disposition of targeted content.
1818
type Descriptor struct {

0 commit comments

Comments
 (0)