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

fix: include error message when policy context creation failed (#10566)

* fix: include error message when policy context creation failed

Signed-off-by: airycanon <airycanon@airycanon.me>

* Update pkg/webhooks/resource/validation/validation.go

Co-authored-by: shuting <shuting@nirmata.com>
Signed-off-by: Yukun Wang <airycanon@airycanon.me>

---------

Signed-off-by: airycanon <airycanon@airycanon.me>
Signed-off-by: Yukun Wang <airycanon@airycanon.me>
Co-authored-by: shuting <shuting@nirmata.com>
This commit is contained in:
Yukun Wang 2024-07-01 21:29:11 +08:00 committed by GitHub
parent 3c771fba23
commit 8890fffafb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -92,7 +92,8 @@ func (v *validationHandler) HandleValidationEnforce(
policyContext, err := v.buildPolicyContextFromAdmissionRequest(logger, request)
if err != nil {
return false, "failed create policy context", nil
msg := fmt.Sprintf("failed to create policy context: %v", err)
return false, msg, nil
}
var engineResponses []engineapi.EngineResponse