From eb5fcf82b0f98d1365523fb914dab0735e2af5c7 Mon Sep 17 00:00:00 2001 From: xiekeyang Date: Thu, 16 Mar 2017 15:27:06 +0800 Subject: [PATCH 1/3] Extension of deadline in make lint Signed-off-by: xiekeyang --- .tool/lint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.tool/lint b/.tool/lint index f2fc72c82..44fa2b26b 100755 --- a/.tool/lint +++ b/.tool/lint @@ -20,5 +20,5 @@ for d in $(find . -type d -not -iwholename '*.git*' -a -not -iname '.tool' -a -n --disable=gas \ --cyclo-over=35 \ --tests \ - --deadline=10s "${d}" + --deadline=15s "${d}" done From 91ab5222f3898f4f8a18b0f2c3b23a3ec83ab8fe Mon Sep 17 00:00:00 2001 From: xiekeyang Date: Thu, 16 Mar 2017 14:50:03 +0800 Subject: [PATCH 2/3] define media type for oci-layout To add a new specific media type for oci-layout, serving over its transportation. Signed-off-by: xiekeyang --- image-layout.md | 1 + media-types.md | 1 + 2 files changed, 2 insertions(+) diff --git a/image-layout.md b/image-layout.md index 9a39a19ce..476e18cce 100644 --- a/image-layout.md +++ b/image-layout.md @@ -129,6 +129,7 @@ $ cat ./blobs/sha256/e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7f 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. 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. +This section defines the `application/vnd.oci.layout.header.v1+json` [media type](media-types.md). ### oci-layout Example diff --git a/media-types.md b/media-types.md index 671b7b00d..1f5c7e81e 100644 --- a/media-types.md +++ b/media-types.md @@ -3,6 +3,7 @@ The following media types identify the formats described here and their referenced resources: - `application/vnd.oci.descriptor.v1+json`: [Content Descriptor](descriptor.md) +- `application/vnd.oci.layout.header.v1+json`: [OCI Layout](image-layout.md#oci-layout-file) - `application/vnd.oci.image.index.v1+json`: [Image Index](image-index.md) - `application/vnd.oci.image.manifest.v1+json`: [Image manifest](manifest.md#image-manifest) - `application/vnd.oci.image.config.v1+json`: [Image config](config.md) From a7a2073f6eb9b7f17290b289de666003db1783d0 Mon Sep 17 00:00:00 2001 From: xiekeyang Date: Thu, 16 Mar 2017 15:16:18 +0800 Subject: [PATCH 3/3] media type of oci-layout as key word for schema map As we have defined media type for oci-layout, now we can use it as the key word in schema map. Signed-off-by: xiekeyang --- image-layout.md | 2 +- schema/schema.go | 22 +++++++++++----------- specs-go/v1/mediatype.go | 3 +++ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/image-layout.md b/image-layout.md index 476e18cce..e9c3b8ce1 100644 --- a/image-layout.md +++ b/image-layout.md @@ -133,7 +133,7 @@ This section defines the `application/vnd.oci.layout.header.v1+json` [media type ### oci-layout Example -```json,title=OCI%20Layout&mediatype=oci%2Dlayout +```json,title=OCI%20Layout&mediatype=application/vnd.oci.layout.header.v1%2Bjson { "imageLayoutVersion": "1.0.0" } diff --git a/schema/schema.go b/schema/schema.go index cd6745174..6f60122db 100644 --- a/schema/schema.go +++ b/schema/schema.go @@ -22,12 +22,12 @@ import ( // Media types for the OCI image formats const ( - ValidatorMediaTypeDescriptor Validator = v1.MediaTypeDescriptor - ValidatorMediaTypeManifest Validator = v1.MediaTypeImageManifest - ValidatorMediaTypeImageIndex Validator = v1.MediaTypeImageIndex - ValidatorMediaTypeImageConfig Validator = v1.MediaTypeImageConfig - ValidatorTypeImageLayout Validator = v1.ImageLayoutFile - ValidatorMediaTypeImageLayer unimplemented = v1.MediaTypeImageLayer + ValidatorMediaTypeDescriptor Validator = v1.MediaTypeDescriptor + ValidatorMediaTypeLayoutHeader Validator = v1.MediaTypeLayoutHeader + ValidatorMediaTypeManifest Validator = v1.MediaTypeImageManifest + ValidatorMediaTypeImageIndex Validator = v1.MediaTypeImageIndex + ValidatorMediaTypeImageConfig Validator = v1.MediaTypeImageConfig + ValidatorMediaTypeImageLayer unimplemented = v1.MediaTypeImageLayer ) var ( @@ -37,11 +37,11 @@ var ( // specs maps OCI schema media types to schema files. specs = map[Validator]string{ - ValidatorMediaTypeDescriptor: "content-descriptor.json", - ValidatorMediaTypeManifest: "image-manifest-schema.json", - ValidatorMediaTypeImageIndex: "image-index-schema.json", - ValidatorMediaTypeImageConfig: "config-schema.json", - ValidatorTypeImageLayout: "image-layout-schema.json", + ValidatorMediaTypeDescriptor: "content-descriptor.json", + ValidatorMediaTypeLayoutHeader: "image-layout-schema.json", + ValidatorMediaTypeManifest: "image-manifest-schema.json", + ValidatorMediaTypeImageIndex: "image-index-schema.json", + ValidatorMediaTypeImageConfig: "config-schema.json", } ) diff --git a/specs-go/v1/mediatype.go b/specs-go/v1/mediatype.go index c3f2e8ab4..bad7bb97f 100644 --- a/specs-go/v1/mediatype.go +++ b/specs-go/v1/mediatype.go @@ -18,6 +18,9 @@ const ( // MediaTypeDescriptor specifies the media type for a content descriptor. MediaTypeDescriptor = "application/vnd.oci.descriptor.v1+json" + // MediaTypeLayoutHeader specifies the media type for the oci-layout. + MediaTypeLayoutHeader = "application/vnd.oci.layout.header.v1+json" + // MediaTypeImageManifest specifies the media type for an image manifest. MediaTypeImageManifest = "application/vnd.oci.image.manifest.v1+json"