diff --git a/cmd/validate/image_test.go b/cmd/validate/image_test.go index e315fc95d..dd78ef6f7 100644 --- a/cmd/validate/image_test.go +++ b/cmd/validate/image_test.go @@ -1240,7 +1240,6 @@ func TestValidateImageDefaultOutput(t *testing.T) { Component: Unnamed ImageRef: registry/image:tag - Results: `) cases := []struct { @@ -1254,6 +1253,7 @@ func TestValidateImageDefaultOutput(t *testing.T) { { args: append(commonArgs, "--show-successes"), expected: fmt.Sprintf("%s%s", commonOutput, hd.Doc(` + Results: ✓ [Success] policy.nice ImageRef: registry/image:tag Title: Very nice diff --git a/internal/applicationsnapshot/templates/text_report.tmpl b/internal/applicationsnapshot/templates/text_report.tmpl index a99ec10d5..ab34b9260 100644 --- a/internal/applicationsnapshot/templates/text_report.tmpl +++ b/internal/applicationsnapshot/templates/text_report.tmpl @@ -7,7 +7,7 @@ Result: {{ $t.Result }} Violations: {{ $t.Failures }}, Warnings: {{ $t.Warnings }}, Successes: {{ $t.Successes }}{{ nl -}} {{- template "_components.tmpl" $c -}} -{{- if or (or (gt $t.Failures 0) (gt $t.Warnings 0)) (gt $t.Successes 0) -}} +{{- if or (gt $t.Failures 0) (gt $t.Warnings 0) (and (gt $t.Successes 0) $r.ShowSuccesses) -}} Results:{{ nl -}} {{- if gt $t.Failures 0 -}} {{- template "_results.tmpl" (toMap "Components" $c "Type" "Violation") -}}