mirror of
https://github.com/yannh/kubeconform.git
synced 2026-04-16 09:09:53 +00:00
Better logging messages
This commit is contained in:
parent
ae5fbffb95
commit
11cfca1498
4 changed files with 20 additions and 11 deletions
|
|
@ -46,7 +46,14 @@ func Validate(rawResource []byte, schema *gojsonschema.Schema) error {
|
|||
}
|
||||
|
||||
if !results.Valid() {
|
||||
return InvalidResourceError{err: fmt.Sprintf("resource does not conform to schema: %+v", results)}
|
||||
msg := ""
|
||||
for _, errMsg := range results.Errors() {
|
||||
if msg != "" {
|
||||
msg += " - "
|
||||
}
|
||||
msg += errMsg.Description()
|
||||
}
|
||||
return InvalidResourceError{err: msg}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue