mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-27 21:31:59 +00:00
minor nits
This commit is contained in:
parent
b4547ce367
commit
8fc1df8d8b
5 changed files with 24 additions and 24 deletions
2
Makefile
2
Makefile
|
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/make -f
|
||||
|
||||
.PHONY: test-build test build build-static docker-test docker-build-static
|
||||
|
||||
test-build: test build
|
||||
|
||||
test:
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ import (
|
|||
|
||||
const (
|
||||
VALID = iota
|
||||
INVALID = iota
|
||||
ERROR = iota
|
||||
SKIPPED = iota
|
||||
INVALID
|
||||
ERROR
|
||||
SKIPPED
|
||||
)
|
||||
|
||||
type Output interface {
|
||||
|
|
|
|||
|
|
@ -56,7 +56,5 @@ func (r LocalSchemas) DownloadSchema(resourceKind, resourceAPIVersion, k8sVersio
|
|||
return nil, fmt.Errorf("failed to open schema %s", schemaFile)
|
||||
}
|
||||
defer f.Close()
|
||||
content, err := ioutil.ReadAll(f)
|
||||
|
||||
return content, err
|
||||
return ioutil.ReadAll(f)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,10 @@ func Validate(rawResource []byte, schema *gojsonschema.Schema) error {
|
|||
return fmt.Errorf("problem validating schema. Check JSON formatting: %s", err)
|
||||
}
|
||||
|
||||
if !results.Valid() {
|
||||
if results.Valid() {
|
||||
return nil
|
||||
}
|
||||
|
||||
msg := ""
|
||||
for _, errMsg := range results.Errors() {
|
||||
if msg != "" {
|
||||
|
|
@ -55,6 +58,3 @@ func Validate(rawResource []byte, schema *gojsonschema.Schema) error {
|
|||
}
|
||||
return InvalidResourceError{err: msg}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue