mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-11 14:09:21 +00:00
fine-tune text logging
This commit is contained in:
parent
52437c00d1
commit
5920cccf07
2 changed files with 6 additions and 2 deletions
|
|
@ -43,7 +43,7 @@
|
|||
@test "Return relevant error for non-existent file" {
|
||||
run bin/kubeconform fixtures/not-here
|
||||
[ "$status" -eq 1 ]
|
||||
[ "$output" = "fixtures/not-here - failed validation: open fixtures/not-here: no such file or directory" ]
|
||||
[ "$output" = "fixtures/not-here - failed validation: open fixtures/not-here: no such file or directory" ]
|
||||
}
|
||||
|
||||
@test "Fail when parsing a config with additional properties and strict set" {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,11 @@ func (o *text) Write(filename, kind, name, version string, reserr error, skipped
|
|||
_, err = fmt.Fprintf(o.w, "%s - %s %s is invalid: %s\n", filename, kind, name, reserr)
|
||||
o.nInvalid++
|
||||
case ERROR:
|
||||
_, err = fmt.Fprintf(o.w, "%s - %s %s failed validation: %s\n", filename, kind, name, reserr)
|
||||
if kind != "" && name != "" {
|
||||
_, err = fmt.Fprintf(o.w, "%s - %s %s failed validation: %s\n", filename, kind, name, reserr)
|
||||
} else {
|
||||
_, err = fmt.Fprintf(o.w, "%s - failed validation: %s\n", filename, reserr)
|
||||
}
|
||||
o.nErrors++
|
||||
case SKIPPED:
|
||||
if o.verbose {
|
||||
|
|
|
|||
Loading…
Reference in a new issue