mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-11 05:59:22 +00:00
Avoid unnecessary type conversions (#222)
This commit is contained in:
parent
ae67bb4709
commit
13a78ebad8
1 changed files with 2 additions and 2 deletions
|
|
@ -2,11 +2,11 @@
|
|||
package validator
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
jsonschema "github.com/santhosh-tekuri/jsonschema/v5"
|
||||
_ "github.com/santhosh-tekuri/jsonschema/v5/httploader"
|
||||
|
|
@ -257,7 +257,7 @@ func downloadSchema(registries []registry.Registry, kind, version, k8sVersion st
|
|||
if err == nil {
|
||||
c := jsonschema.NewCompiler()
|
||||
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
|
||||
}
|
||||
schema, err := c.Compile(path)
|
||||
|
|
|
|||
Loading…
Reference in a new issue