mirror of
https://github.com/yannh/kubeconform.git
synced 2026-04-11 07:24:17 +00:00
feat(output/tap): Output qualified resource name
This commit is contained in:
parent
c1b3e93a75
commit
ff2ab3d770
4 changed files with 11 additions and 5 deletions
|
|
@ -40,11 +40,11 @@ func (o *tapo) Write(res validator.Result) error {
|
|||
switch res.Status {
|
||||
case validator.Valid:
|
||||
sig, _ := res.Resource.Signature()
|
||||
fmt.Fprintf(o.w, "ok %d - %s (%s)\n", o.index, res.Resource.Path, sig.Kind)
|
||||
fmt.Fprintf(o.w, "ok %d - %s (%s)\n", o.index, res.Resource.Path, sig.QualifiedName())
|
||||
|
||||
case validator.Invalid:
|
||||
sig, _ := res.Resource.Signature()
|
||||
fmt.Fprintf(o.w, "not ok %d - %s (%s): %s\n", o.index, res.Resource.Path, sig.Kind, res.Err.Error())
|
||||
fmt.Fprintf(o.w, "not ok %d - %s (%s): %s\n", o.index, res.Resource.Path, sig.QualifiedName(), res.Err.Error())
|
||||
|
||||
case validator.Empty:
|
||||
fmt.Fprintf(o.w, "ok %d - %s (empty)\n", o.index, res.Resource.Path)
|
||||
|
|
@ -53,7 +53,8 @@ func (o *tapo) Write(res validator.Result) error {
|
|||
fmt.Fprintf(o.w, "not ok %d - %s: %s\n", o.index, res.Resource.Path, res.Err.Error())
|
||||
|
||||
case validator.Skipped:
|
||||
fmt.Fprintf(o.w, "ok %d #skip - %s\n", o.index, res.Resource.Path)
|
||||
sig, _ := res.Resource.Signature()
|
||||
fmt.Fprintf(o.w, "ok %d - %s (%s) # skip\n", o.index, res.Resource.Path, sig.QualifiedName())
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ metadata:
|
|||
Err: nil,
|
||||
},
|
||||
},
|
||||
"TAP version 13\nok 1 - deployment.yml (Deployment)\n1..1\n",
|
||||
"TAP version 13\nok 1 - deployment.yml (apps/v1/Deployment//my-app)\n1..1\n",
|
||||
},
|
||||
{
|
||||
"a single deployment, verbose, with summary",
|
||||
|
|
@ -57,7 +57,7 @@ metadata:
|
|||
Err: nil,
|
||||
},
|
||||
},
|
||||
"TAP version 13\nok 1 - deployment.yml (Deployment)\n1..1\n",
|
||||
"TAP version 13\nok 1 - deployment.yml (apps/v1/Deployment//my-app)\n1..1\n",
|
||||
},
|
||||
} {
|
||||
w := new(bytes.Buffer)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue