1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-15 17:51:20 +00:00

fix: add message to bypass schema validation when it fails (#6604) (#6606)

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
gcp-cherry-pick-bot[bot] 2023-03-16 17:20:12 +00:00 committed by GitHub
parent fcb350674e
commit 9b4f96ddda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -424,7 +424,7 @@ func Validate(policy kyvernov1.PolicyInterface, client dclient.Interface, mock b
}
if !mock && (spec.SchemaValidation == nil || *spec.SchemaValidation) {
if err := openApiManager.ValidatePolicyMutation(policy); err != nil {
return warnings, err
return warnings, fmt.Errorf("%s (you can bypass schema validation by setting `spec.schemaValidation: false`)", err)
}
}
return warnings, nil