1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-05 15:37:19 +00:00
kyverno/pkg/engine/variables/errs.go
shuting 18455b4d21
feat: cleanup enhancements-1 (#5796)
* update fields description

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update cleanup controller clusterrole name

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* - add variables validations to support "request." and "images."; - update debug log level to 4

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add missing files

Signed-off-by: ShutingZhao <shuting@nirmata.com>

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2023-01-04 09:03:56 +00:00

21 lines
363 B
Go

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
}