mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-18 09:27:02 +00:00
Avoid unnecessary type conversions
This commit is contained in:
parent
ae67bb4709
commit
b699dc5f94
1 changed files with 2 additions and 2 deletions
|
|
@ -2,11 +2,11 @@
|
||||||
package validator
|
package validator
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
|
||||||
|
|
||||||
jsonschema "github.com/santhosh-tekuri/jsonschema/v5"
|
jsonschema "github.com/santhosh-tekuri/jsonschema/v5"
|
||||||
_ "github.com/santhosh-tekuri/jsonschema/v5/httploader"
|
_ "github.com/santhosh-tekuri/jsonschema/v5/httploader"
|
||||||
|
|
@ -257,7 +257,7 @@ func downloadSchema(registries []registry.Registry, kind, version, k8sVersion st
|
||||||
if err == nil {
|
if err == nil {
|
||||||
c := jsonschema.NewCompiler()
|
c := jsonschema.NewCompiler()
|
||||||
c.Draft = jsonschema.Draft4
|
c.Draft = jsonschema.Draft4
|
||||||
if err := c.AddResource(path, strings.NewReader(string(schemaBytes))); err != nil {
|
if err := c.AddResource(path, bytes.NewReader(schemaBytes)); err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
schema, err := c.Compile(path)
|
schema, err := c.Compile(path)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue