mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-05 15:37:19 +00:00
* 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>
21 lines
363 B
Go
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
|
|
}
|