diff --git a/kubeconform b/kubeconform new file mode 100755 index 0000000..3617a64 Binary files /dev/null and b/kubeconform differ diff --git a/pkg/output/tap.go b/pkg/output/tap.go index 8ef8563..4e70823 100644 --- a/pkg/output/tap.go +++ b/pkg/output/tap.go @@ -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 diff --git a/pkg/output/tap_test.go b/pkg/output/tap_test.go index 8fce042..8ebe94e 100644 --- a/pkg/output/tap_test.go +++ b/pkg/output/tap_test.go @@ -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) diff --git a/pkg/resource/resource.go b/pkg/resource/resource.go index e4e8d30..6bf9eed 100644 --- a/pkg/resource/resource.go +++ b/pkg/resource/resource.go @@ -119,3 +119,8 @@ func (res *Resource) Resources() []Resource { return []Resource{*res} } + +// QualifiedName returns a string for a signature in the format version/kind/namespace/name +func (sig *Signature) QualifiedName() string { + return fmt.Sprintf("%s/%s/%s/%s", sig.Version, sig.Kind, sig.Namespace, sig.Name) +}