Re-vendor, and use mtrmac/image-spec:id-based-loader to fix tests

Anyone running (vndr) currently ends up with failing tests in OCI schema
validation because gojsonschema has fixed its "$ref" interpretation, exposing
inconsistent URI usage inside image-spec/schema.

So, this runs (vndr), and uses mtrmac/image-spec:id-based-loader
( https://github.com/opencontainers/image-spec/pull/739 ) to make the tests pass
again.  As soon as that PR is merged we should revert to using the upstream
image-spec repo again.
This commit is contained in:
Miloslav Trmač
2018-01-10 20:32:58 +01:00
parent 22c524b0e0
commit dc1567c8bc
170 changed files with 14354 additions and 1523 deletions

View File

@@ -67,7 +67,7 @@ func (v Validator) Validate(src io.Reader) error {
}
}
sl := gojsonschema.NewReferenceLoaderFileSystem("file:///"+specs[v], fs)
sl := newFSLoaderFactory(schemaNamespaces, fs).New(specs[v])
ml := gojsonschema.NewStringLoader(string(buf))
result, err := gojsonschema.Validate(sl, ml)
@@ -157,7 +157,7 @@ func validateIndex(r io.Reader) error {
err = json.Unmarshal(buf, &header)
if err != nil {
return errors.Wrap(err, "manifestlist format mismatch")
return errors.Wrap(err, "index format mismatch")
}
for _, manifest := range header.Manifests {
@@ -217,8 +217,8 @@ func checkPlatform(OS string, Architecture string) {
return
}
}
fmt.Printf("warning: combination of %q and %q is invalid.", OS, Architecture)
fmt.Printf("warning: combination of %q and %q is invalid.\n", OS, Architecture)
}
}
fmt.Printf("warning: operating system %q of the bundle is not supported yet.", OS)
fmt.Printf("warning: operating system %q of the bundle is not supported yet.\n", OS)
}