mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
fix test output numbering (#4853)
Signed-off-by: Anant Vijay <anantvijay3@gmail.com> Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
This commit is contained in:
parent
2860775dc3
commit
df12c80b95
1 changed files with 8 additions and 2 deletions
|
@ -1037,9 +1037,13 @@ func printTestResult(resps map[string]policyreportv1alpha2.PolicyReportResult, t
|
|||
boldFgCyan := color.New(color.FgCyan).Add(color.Bold)
|
||||
|
||||
var countDeprecatedResource int
|
||||
for i, v := range testResults {
|
||||
testCount := 1
|
||||
for _, v := range testResults {
|
||||
res := new(Table)
|
||||
res.ID = i + 1
|
||||
res.ID = testCount
|
||||
if v.Resources == nil {
|
||||
testCount++
|
||||
}
|
||||
if !removeColor {
|
||||
res.Policy = boldFgCyan.Sprintf(v.Policy)
|
||||
res.Rule = boldFgCyan.Sprintf(v.Rule)
|
||||
|
@ -1050,6 +1054,8 @@ func printTestResult(resps map[string]policyreportv1alpha2.PolicyReportResult, t
|
|||
|
||||
if v.Resources != nil {
|
||||
for _, resource := range v.Resources {
|
||||
res.ID = testCount
|
||||
testCount++
|
||||
if !removeColor {
|
||||
res.Resource = boldFgCyan.Sprintf(v.Namespace) + "/" + boldFgCyan.Sprintf(v.Kind) + "/" + boldFgCyan.Sprintf(resource)
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue