mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-18 17:37:03 +00:00
update validationErrors format in json output
This commit is contained in:
parent
e56c6bee81
commit
2b4dc8f9f2
1 changed files with 5 additions and 5 deletions
|
|
@ -28,12 +28,12 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
type ValidationError struct {
|
type ValidationError struct {
|
||||||
Path string
|
Path string `json:"path"`
|
||||||
Message string
|
Msg string `json:"msg"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ve *ValidationError) Error() string {
|
func (ve *ValidationError) Error() string {
|
||||||
return ve.Message
|
return ve.Msg
|
||||||
}
|
}
|
||||||
|
|
||||||
// Result contains the details of the result of a resource validation
|
// Result contains the details of the result of a resource validation
|
||||||
|
|
@ -197,8 +197,8 @@ func (val *v) ValidateResource(res resource.Resource) Result {
|
||||||
if errors.As(err, &e) {
|
if errors.As(err, &e) {
|
||||||
for _, ve := range e.Causes {
|
for _, ve := range e.Causes {
|
||||||
validationErrors = append(validationErrors, ValidationError{
|
validationErrors = append(validationErrors, ValidationError{
|
||||||
Path: ve.KeywordLocation,
|
Path: ve.KeywordLocation,
|
||||||
Message: ve.Message,
|
Msg: ve.Message,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue