Skip to content

Commit

Permalink
*: PR review
Browse files Browse the repository at this point in the history
I had blanked on the schema-fs target, and consequently had inncorrect
results from `validate-examples`.

This fixes those issues as well as makes `validate-examples`
automatically update `schema-fs` if there have been changes to the JSON
schema

Signed-off-by: Vincent Batts <[email protected]>
  • Loading branch information
vbatts committed Jan 27, 2017
1 parent 3463379 commit 0f29fa3
Show file tree
Hide file tree
Showing 6 changed files with 300 additions and 117 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ $(OUTPUT_DIRNAME)/$(DOC_FILENAME).html: $(DOC_FILES) $(FIGURE_FILES)
ls -sh $(shell readlink -f $@)
endif

validate-examples:
validate-examples: schema/fs.go
go test -run TestValidate ./schema

schema-fs:
schema/fs.go: $(wildcard schema/*.json)
cd schema && printf "%s\n\n%s\n" "$$(cat ../.header)" "$$(go generate)" > fs.go

schema-fs: schema/fs.go
@echo "generating schema fs"
@cd schema && printf "%s\n\n%s\n" "$$(cat ../.header)" "$$(go generate)" > fs.go

check-license:
@echo "checking license headers"
Expand Down
7 changes: 1 addition & 6 deletions image-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,11 @@ From the base properties of the [manifest-list](manifest-list.md), this object w
```json,title=Manifest%20List&mediatype=application/vnd.oci.image.manifest.list.v1%2Bjson
{
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image.manifest.list.v1+json",
"manifests": [
{
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"size": 7143,
"digest": "sha256:e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7fc331f",
"platform": {
"architecture": "amd64",
"os": "linux"
},
"annotations": {
"org.opencontainers.ref.name": "v1.0"
}
Expand All @@ -191,7 +186,7 @@ From the base properties of the [manifest-list](manifest-list.md), this object w
"elements": [
{
"mediaType": "application/xml",
"Asize": 7143,
"size": 7143,
"digest": "sha256:b3d63d132d21c3ff4c35a061adf23cf43da8ae054247e32faa95494d904a007e",
"annotations": {
"org.freedesktop.specifications.metainfo.version": "1.0",
Expand Down
3 changes: 2 additions & 1 deletion manifest-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ For the media type(s) that this document is compatible with, see the [matrix][ma

This REQUIRED property specifies the image manifest schema version.
For this version of the specification, this MUST be `2` to ensure backward compatibility with older versions of Docker.
The value of this field will not change. This field MAY be removed in a future version of the specification.
The value of this field will not change
This field MAY be removed in a future version of the specification.

- **`mediaType`** *string*

Expand Down
34 changes: 0 additions & 34 deletions schema/defs-image.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,6 @@
"type": "string",
"pattern": "^[a-z0-9_+.-]+:[a-f0-9]+$"
},
"elementDescriptor": {
"id": "https://opencontainers.org/schema/image/manifestDescriptor",
"type": "object",
"required": [
"mediaType",
"size",
"digest"
],
"properties": {
"mediaType": {
"description": "the mediatype of the referenced object",
"$ref": "#/definitions/mediaType"
},
"size": {
"description": "the size in bytes of the referenced object",
"$ref": "defs.json#/definitions/int64"
},
"digest": {
"description": "the cryptographic checksum digest of the object, in the pattern '<hash>:<hexadecimal digest>'",
"$ref": "#/definitions/digest"
},
"annotations": {
"id": "https://opencontainers.org/schema/image/annotations",
"oneOf": [
{
"$ref": "defs.json#/definitions/mapStringString"
},
{
"type": "null"
}
]
}
}
},
"manifestDescriptor": {
"id": "https://opencontainers.org/schema/image/manifestDescriptor",
"type": "object",
Expand Down
Loading

0 comments on commit 0f29fa3

Please sign in to comment.