Skip to content

Commit d24a3c9

Browse files
authored
Merge pull request #610 from xiekeyang/oci-layout
define media type for oci-layout
2 parents f59a917 + a7a2073 commit d24a3c9

File tree

5 files changed

+18
-13
lines changed

5 files changed

+18
-13
lines changed

.tool/lint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ for d in $(find . -type d -not -iwholename '*.git*' -a -not -iname '.tool' -a -n
2020
--disable=gas \
2121
--cyclo-over=35 \
2222
--tests \
23-
--deadline=10s "${d}"
23+
--deadline=15s "${d}"
2424
done

image-layout.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,11 @@ $ cat ./blobs/sha256/e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7f
129129

130130
This JSON object serves as a marker for the base of an Open Container Image Layout and to provide the version of the image-layout in use.
131131
The `imageLayoutVersion` value will align with the OCI Image Specification version at the time changes to the layout are made, and will pin a given version until changes to the image layout are required.
132+
This section defines the `application/vnd.oci.layout.header.v1+json` [media type](media-types.md).
132133

133134
### oci-layout Example
134135

135-
```json,title=OCI%20Layout&mediatype=oci%2Dlayout
136+
```json,title=OCI%20Layout&mediatype=application/vnd.oci.layout.header.v1%2Bjson
136137
{
137138
"imageLayoutVersion": "1.0.0"
138139
}

media-types.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
The following media types identify the formats described here and their referenced resources:
44

55
- `application/vnd.oci.descriptor.v1+json`: [Content Descriptor](descriptor.md)
6+
- `application/vnd.oci.layout.header.v1+json`: [OCI Layout](image-layout.md#oci-layout-file)
67
- `application/vnd.oci.image.index.v1+json`: [Image Index](image-index.md)
78
- `application/vnd.oci.image.manifest.v1+json`: [Image manifest](manifest.md#image-manifest)
89
- `application/vnd.oci.image.config.v1+json`: [Image config](config.md)

schema/schema.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ import (
2222

2323
// Media types for the OCI image formats
2424
const (
25-
ValidatorMediaTypeDescriptor Validator = v1.MediaTypeDescriptor
26-
ValidatorMediaTypeManifest Validator = v1.MediaTypeImageManifest
27-
ValidatorMediaTypeImageIndex Validator = v1.MediaTypeImageIndex
28-
ValidatorMediaTypeImageConfig Validator = v1.MediaTypeImageConfig
29-
ValidatorTypeImageLayout Validator = v1.ImageLayoutFile
30-
ValidatorMediaTypeImageLayer unimplemented = v1.MediaTypeImageLayer
25+
ValidatorMediaTypeDescriptor Validator = v1.MediaTypeDescriptor
26+
ValidatorMediaTypeLayoutHeader Validator = v1.MediaTypeLayoutHeader
27+
ValidatorMediaTypeManifest Validator = v1.MediaTypeImageManifest
28+
ValidatorMediaTypeImageIndex Validator = v1.MediaTypeImageIndex
29+
ValidatorMediaTypeImageConfig Validator = v1.MediaTypeImageConfig
30+
ValidatorMediaTypeImageLayer unimplemented = v1.MediaTypeImageLayer
3131
)
3232

3333
var (
@@ -37,11 +37,11 @@ var (
3737

3838
// specs maps OCI schema media types to schema files.
3939
specs = map[Validator]string{
40-
ValidatorMediaTypeDescriptor: "content-descriptor.json",
41-
ValidatorMediaTypeManifest: "image-manifest-schema.json",
42-
ValidatorMediaTypeImageIndex: "image-index-schema.json",
43-
ValidatorMediaTypeImageConfig: "config-schema.json",
44-
ValidatorTypeImageLayout: "image-layout-schema.json",
40+
ValidatorMediaTypeDescriptor: "content-descriptor.json",
41+
ValidatorMediaTypeLayoutHeader: "image-layout-schema.json",
42+
ValidatorMediaTypeManifest: "image-manifest-schema.json",
43+
ValidatorMediaTypeImageIndex: "image-index-schema.json",
44+
ValidatorMediaTypeImageConfig: "config-schema.json",
4545
}
4646
)
4747

specs-go/v1/mediatype.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ const (
1818
// MediaTypeDescriptor specifies the media type for a content descriptor.
1919
MediaTypeDescriptor = "application/vnd.oci.descriptor.v1+json"
2020

21+
// MediaTypeLayoutHeader specifies the media type for the oci-layout.
22+
MediaTypeLayoutHeader = "application/vnd.oci.layout.header.v1+json"
23+
2124
// MediaTypeImageManifest specifies the media type for an image manifest.
2225
MediaTypeImageManifest = "application/vnd.oci.image.manifest.v1+json"
2326

0 commit comments

Comments
 (0)