1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

Fix pr image verify blocked (#4297)

* update log levels

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* do not generate policy reports for blocked images

Signed-off-by: Jim Bugwadia <jim@nirmata.com>
This commit is contained in:
Jim Bugwadia 2022-08-03 22:27:09 -07:00 committed by GitHub
parent 421b490c56
commit 66c3b3b8d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -430,9 +430,6 @@ func (h *handlers) handleVerifyImages(logger logr.Logger, request *admissionv1.A
verifiedImageData.Merge(ivm)
}
prInfos := policyreport.GeneratePRsFromEngineResponse(engineResponses, logger)
h.prGenerator.Add(prInfos...)
failurePolicy := policyContext.Policy.GetSpec().GetFailurePolicy()
blocked := blockRequest(engineResponses, failurePolicy, logger)
if !isResourceDeleted(policyContext) {
@ -445,6 +442,9 @@ func (h *handlers) handleVerifyImages(logger logr.Logger, request *admissionv1.A
return false, getBlockedMessages(engineResponses), nil, nil
}
prInfos := policyreport.GeneratePRsFromEngineResponse(engineResponses, logger)
h.prGenerator.Add(prInfos...)
if !verifiedImageData.IsEmpty() {
hasAnnotations := hasAnnotations(policyContext)
annotationPatches, err := verifiedImageData.Patches(hasAnnotations, logger)