mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-29 02:45:06 +00:00
Add Support for previouse test file structure (#2329)
Signed-off-by: Frank Jogeleit <frank.jogeleit@web.de>
This commit is contained in:
parent
555f0a8d75
commit
8eab9d45a6
2 changed files with 9 additions and 5 deletions
|
@ -82,6 +82,7 @@ type TestResults struct {
|
|||
Policy string `json:"policy"`
|
||||
Rule string `json:"rule"`
|
||||
Result report.PolicyResult `json:"result"`
|
||||
Status report.PolicyResult `json:"status"`
|
||||
Resource string `json:"resource"`
|
||||
}
|
||||
|
||||
|
@ -429,6 +430,9 @@ func printTestResult(resps map[string]report.PolicyReportResult, testResults []T
|
|||
table = append(table, res)
|
||||
continue
|
||||
}
|
||||
if v.Result == "" && v.Status != "" {
|
||||
v.Result = v.Status
|
||||
}
|
||||
if testRes.Result == v.Result {
|
||||
if testRes.Result == report.StatusSkip {
|
||||
res.Result = boldGreen.Sprintf("Pass")
|
||||
|
|
|
@ -7,20 +7,20 @@ results:
|
|||
- policy: disallow-latest-tag
|
||||
rule: require-image-tag
|
||||
resource: test-require-image-tag-pass
|
||||
result: pass
|
||||
status: pass
|
||||
- policy: disallow-latest-tag
|
||||
rule: require-image-tag
|
||||
resource: test-require-image-tag-fail
|
||||
result: fail
|
||||
status: fail
|
||||
- policy: disallow-latest-tag
|
||||
rule: validate-image-tag
|
||||
resource: test-validate-image-tag-ignore
|
||||
result: skip
|
||||
status: skip
|
||||
- policy: disallow-latest-tag
|
||||
rule: validate-image-tag
|
||||
resource: test-validate-image-tag-fail
|
||||
result: fail
|
||||
status: fail
|
||||
- policy: disallow-latest-tag
|
||||
rule: validate-image-tag
|
||||
resource: test-validate-image-tag-pass
|
||||
result: pass
|
||||
status: pass
|
||||
|
|
Loading…
Add table
Reference in a new issue