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:
parent
3c771fba23
commit
8890fffafb
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue