mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +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)
|
boldFgCyan := color.New(color.FgCyan).Add(color.Bold)
|
||||||
|
|
||||||
var countDeprecatedResource int
|
var countDeprecatedResource int
|
||||||
for i, v := range testResults {
|
testCount := 1
|
||||||
|
for _, v := range testResults {
|
||||||
res := new(Table)
|
res := new(Table)
|
||||||
res.ID = i + 1
|
res.ID = testCount
|
||||||
|
if v.Resources == nil {
|
||||||
|
testCount++
|
||||||
|
}
|
||||||
if !removeColor {
|
if !removeColor {
|
||||||
res.Policy = boldFgCyan.Sprintf(v.Policy)
|
res.Policy = boldFgCyan.Sprintf(v.Policy)
|
||||||
res.Rule = boldFgCyan.Sprintf(v.Rule)
|
res.Rule = boldFgCyan.Sprintf(v.Rule)
|
||||||
|
@ -1050,6 +1054,8 @@ func printTestResult(resps map[string]policyreportv1alpha2.PolicyReportResult, t
|
||||||
|
|
||||||
if v.Resources != nil {
|
if v.Resources != nil {
|
||||||
for _, resource := range v.Resources {
|
for _, resource := range v.Resources {
|
||||||
|
res.ID = testCount
|
||||||
|
testCount++
|
||||||
if !removeColor {
|
if !removeColor {
|
||||||
res.Resource = boldFgCyan.Sprintf(v.Namespace) + "/" + boldFgCyan.Sprintf(v.Kind) + "/" + boldFgCyan.Sprintf(resource)
|
res.Resource = boldFgCyan.Sprintf(v.Namespace) + "/" + boldFgCyan.Sprintf(v.Kind) + "/" + boldFgCyan.Sprintf(resource)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue