1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/pkg/engine/variables/errs.go

22 lines
363 B
Go
Raw Normal View History

package variables
import (
"github.com/jmespath/go-jmespath"
enginecontext "github.com/kyverno/kyverno/pkg/engine/context"
)
func CheckNotFoundErr(err error) bool {
if err != nil {
switch err.(type) {
case jmespath.NotFoundError:
return true
case enginecontext.InvalidVariableError:
return false
default:
return false
}
}
return true
}