mirror of
https://github.com/yannh/kubeconform.git
synced 2026-04-15 00:44:45 +00:00
fail early when a broken -schema-location template is given
This commit is contained in:
parent
905f5e7417
commit
651d3b2c50
5 changed files with 32 additions and 8 deletions
|
|
@ -16,7 +16,10 @@ func main() {
|
|||
log.Fatalf("failed opening %s: %s", filepath, err)
|
||||
}
|
||||
|
||||
v := validator.New(nil, validator.Opts{Strict: true})
|
||||
v, err := validator.New(nil, validator.Opts{Strict: true})
|
||||
if err != nil {
|
||||
log.Fatalf("failed initializing validator: %s", err)
|
||||
}
|
||||
for i, res := range v.Validate(filepath, f) { // A file might contain multiple resources
|
||||
// File starts with ---, the parser assumes a first empty resource
|
||||
if res.Status == validator.Invalid {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue