From 39c58f661fec0b9879a4582152c9fd4bc92ea2da Mon Sep 17 00:00:00 2001 From: NoSkillGirl Date: Fri, 3 Sep 2021 17:17:22 +0530 Subject: [PATCH] added exit code for policy report Signed-off-by: NoSkillGirl --- pkg/kyverno/apply/apply_command.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/kyverno/apply/apply_command.go b/pkg/kyverno/apply/apply_command.go index 42be26aa38..e3878e1100 100644 --- a/pkg/kyverno/apply/apply_command.go +++ b/pkg/kyverno/apply/apply_command.go @@ -346,10 +346,10 @@ func printReportOrViolation(policyReport bool, rc *common.ResultCounts, resource fmt.Printf("\npass: %d, fail: %d, warn: %d, error: %d, skip: %d \n", rc.Pass, rc.Fail, rc.Warn, rc.Error, rc.Skip) } + } - if rc.Fail > 0 || rc.Error > 0 { - os.Exit(1) - } + if rc.Fail > 0 || rc.Error > 0 { + os.Exit(1) } }