mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-18 17:37:03 +00:00
some linting simplifications
This commit is contained in:
parent
fac08ee8cf
commit
c4bd7d0668
3 changed files with 3 additions and 4 deletions
2
main.go
2
main.go
|
|
@ -208,7 +208,7 @@ func realMain() int {
|
||||||
res := validateFile(f, registries, k8sVersion, c, filter)
|
res := validateFile(f, registries, k8sVersion, c, filter)
|
||||||
f.Close()
|
f.Close()
|
||||||
|
|
||||||
for i, _ := range res {
|
for i := range res {
|
||||||
res[i].filename = filename
|
res[i].filename = filename
|
||||||
}
|
}
|
||||||
validationResults <- res
|
validationResults <- res
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,8 @@ func status(err error, skipped bool) int {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if _, ok := err.(validator.InvalidResourceError); ok {
|
if _, ok := err.(validator.InvalidResourceError); ok {
|
||||||
return INVALID
|
return INVALID
|
||||||
} else {
|
|
||||||
return ERROR
|
|
||||||
}
|
}
|
||||||
|
return ERROR
|
||||||
}
|
}
|
||||||
|
|
||||||
return VALID
|
return VALID
|
||||||
|
|
|
||||||
|
|
@ -58,5 +58,5 @@ func (r LocalSchemas) DownloadSchema(resourceKind, resourceAPIVersion, k8sVersio
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
content, err := ioutil.ReadAll(f)
|
content, err := ioutil.ReadAll(f)
|
||||||
|
|
||||||
return content, nil
|
return content, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue