1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-01-20 18:52:16 +00:00
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
This commit is contained in:
Jim Bugwadia 2021-10-02 16:57:40 -07:00
parent e0e6074afc
commit 89d1e4afab
3 changed files with 4 additions and 5 deletions

View file

@ -12,7 +12,6 @@ import (
"github.com/kyverno/kyverno/pkg/engine/wildcards"
)
type PatternError struct {
Err error
Path string

View file

@ -459,7 +459,7 @@ func (v *validator) validatePatterns(resource unstructured.Unstructured) *respon
if v.pattern != nil {
if err := validate.MatchPattern(v.log, resource.Object, v.pattern); err != nil {
if pe, ok := err.(*validate.PatternError); ok{
if pe, ok := err.(*validate.PatternError); ok {
v.log.V(3).Info("validation error", "path", pe.Path, "error", err.Error())
if pe.Path == "" {
return ruleResponse(v.rule, v.buildErrorMessage(err, ""), response.RuleStatusError)