mirror of
https://github.com/containers/skopeo.git
synced 2025-09-10 11:09:47 +00:00
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:
8
vendor/github.com/opencontainers/image-spec/schema/validator.go
generated
vendored
8
vendor/github.com/opencontainers/image-spec/schema/validator.go
generated
vendored
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user