1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-13 19:28:55 +00:00

chore: small nits in cli test command (#9573)

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2024-01-31 02:39:47 +01:00 committed by GitHub
parent 81c70c8b85
commit 13052267d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 10 deletions

View file

@ -122,17 +122,11 @@ func testCommandExecute(
}
fmt.Fprintln(out, " Checking results ...")
var resultsTable table.Table
{
err := printTestResult(out, filteredResults, responses, rc, &resultsTable, test.Fs, resourcePath)
if err != nil {
return fmt.Errorf("failed to print test result (%w)", err)
}
if err := printTestResult(out, filteredResults, responses, rc, &resultsTable, test.Fs, resourcePath); err != nil {
return fmt.Errorf("failed to print test result (%w)", err)
}
{
err := printCheckResult(out, test.Test.Checks, responses, rc, &resultsTable)
if err != nil {
return fmt.Errorf("failed to print test result (%w)", err)
}
if err := printCheckResult(out, test.Test.Checks, responses, rc, &resultsTable); err != nil {
return fmt.Errorf("failed to print test result (%w)", err)
}
fullTable.AddFailed(resultsTable.RawRows...)
printer := table.NewTablePrinter(out)

View file

@ -90,6 +90,7 @@ func runTest(out io.Writer, testCase test.TestCase, registryAccess bool, auditWa
if res.IsValidatingAdmissionPolicy {
continue
}
// TODO: what if two policies have a rule with the same name ?
if rule.Name == res.Rule {
if rule.HasGenerate() {
if len(rule.Generation.CloneList.Kinds) != 0 { // cloneList