mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-11 14:09:21 +00:00
minor nits
This commit is contained in:
parent
8fc1df8d8b
commit
5ff2d1a037
2 changed files with 11 additions and 11 deletions
|
|
@ -36,19 +36,20 @@ func (o *JSONOutput) Write(filename, kind, version string, err error, skipped bo
|
|||
msg, st := "", ""
|
||||
|
||||
s := status(err, skipped)
|
||||
switch {
|
||||
case s == VALID:
|
||||
|
||||
switch s {
|
||||
case VALID:
|
||||
st = "VALID"
|
||||
o.nValid++
|
||||
case s == INVALID:
|
||||
case INVALID:
|
||||
st = "INVALID"
|
||||
msg = err.Error()
|
||||
o.nInvalid++
|
||||
case s == ERROR:
|
||||
case ERROR:
|
||||
st = "ERROR"
|
||||
msg = err.Error()
|
||||
o.nErrors++
|
||||
case s == SKIPPED:
|
||||
case SKIPPED:
|
||||
st = "SKIPPED"
|
||||
o.nSkipped++
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,20 +27,19 @@ func (o *TextOutput) Write(filename, kind, version string, err error, skipped bo
|
|||
o.Lock()
|
||||
defer o.Unlock()
|
||||
|
||||
s := status(err, skipped)
|
||||
switch {
|
||||
case s == VALID:
|
||||
switch status(err, skipped) {
|
||||
case VALID:
|
||||
if !o.quiet {
|
||||
fmt.Printf("%s - %s is valid\n", filename, kind)
|
||||
}
|
||||
o.nValid++
|
||||
case s == INVALID:
|
||||
case INVALID:
|
||||
fmt.Printf("%s - %s is invalid: %s\n", filename, kind, err)
|
||||
o.nInvalid++
|
||||
case s == ERROR:
|
||||
case ERROR:
|
||||
fmt.Printf("%s - %s failed validation: %s\n", filename, kind, err)
|
||||
o.nErrors++
|
||||
case s == SKIPPED:
|
||||
case SKIPPED:
|
||||
if !o.quiet {
|
||||
fmt.Printf("%s - %s skipped\n", filename, kind)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue