Skip to content

Commit 0f29fa3

Browse files
committed
*: PR review
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]>
1 parent 3463379 commit 0f29fa3

File tree

6 files changed

+300
-117
lines changed

6 files changed

+300
-117
lines changed

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,14 @@ $(OUTPUT_DIRNAME)/$(DOC_FILENAME).html: $(DOC_FILES) $(FIGURE_FILES)
7676
ls -sh $(shell readlink -f $@)
7777
endif
7878

79-
validate-examples:
79+
validate-examples: schema/fs.go
8080
go test -run TestValidate ./schema
8181

82-
schema-fs:
82+
schema/fs.go: $(wildcard schema/*.json)
83+
cd schema && printf "%s\n\n%s\n" "$$(cat ../.header)" "$$(go generate)" > fs.go
84+
85+
schema-fs: schema/fs.go
8386
@echo "generating schema fs"
84-
@cd schema && printf "%s\n\n%s\n" "$$(cat ../.header)" "$$(go generate)" > fs.go
8587

8688
check-license:
8789
@echo "checking license headers"

image-layout.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,11 @@ From the base properties of the [manifest-list](manifest-list.md), this object w
173173
```json,title=Manifest%20List&mediatype=application/vnd.oci.image.manifest.list.v1%2Bjson
174174
{
175175
"schemaVersion": 2,
176-
"mediaType": "application/vnd.oci.image.manifest.list.v1+json",
177176
"manifests": [
178177
{
179178
"mediaType": "application/vnd.oci.image.manifest.v1+json",
180179
"size": 7143,
181180
"digest": "sha256:e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7fc331f",
182-
"platform": {
183-
"architecture": "amd64",
184-
"os": "linux"
185-
},
186181
"annotations": {
187182
"org.opencontainers.ref.name": "v1.0"
188183
}
@@ -191,7 +186,7 @@ From the base properties of the [manifest-list](manifest-list.md), this object w
191186
"elements": [
192187
{
193188
"mediaType": "application/xml",
194-
"Asize": 7143,
189+
"size": 7143,
195190
"digest": "sha256:b3d63d132d21c3ff4c35a061adf23cf43da8ae054247e32faa95494d904a007e",
196191
"annotations": {
197192
"org.freedesktop.specifications.metainfo.version": "1.0",

manifest-list.md

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

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

1718
- **`mediaType`** *string*
1819

schema/defs-image.json

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,6 @@
1111
"type": "string",
1212
"pattern": "^[a-z0-9_+.-]+:[a-f0-9]+$"
1313
},
14-
"elementDescriptor": {
15-
"id": "https://opencontainers.org/schema/image/manifestDescriptor",
16-
"type": "object",
17-
"required": [
18-
"mediaType",
19-
"size",
20-
"digest"
21-
],
22-
"properties": {
23-
"mediaType": {
24-
"description": "the mediatype of the referenced object",
25-
"$ref": "#/definitions/mediaType"
26-
},
27-
"size": {
28-
"description": "the size in bytes of the referenced object",
29-
"$ref": "defs.json#/definitions/int64"
30-
},
31-
"digest": {
32-
"description": "the cryptographic checksum digest of the object, in the pattern '<hash>:<hexadecimal digest>'",
33-
"$ref": "#/definitions/digest"
34-
},
35-
"annotations": {
36-
"id": "https://opencontainers.org/schema/image/annotations",
37-
"oneOf": [
38-
{
39-
"$ref": "defs.json#/definitions/mapStringString"
40-
},
41-
{
42-
"type": "null"
43-
}
44-
]
45-
}
46-
}
47-
},
4814
"manifestDescriptor": {
4915
"id": "https://opencontainers.org/schema/image/manifestDescriptor",
5016
"type": "object",

0 commit comments

Comments
 (0)