1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00
kyverno/pkg/engine/variables/errs.go
Charles-Edouard Brétéché 6d9d3b7f4c
fix: remove jmespath replace directive (#7726)
* fix: remove jmespath replace directive

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* master

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-07-07 10:22:26 +00:00

21 lines
362 B
Go

package variables
import (
"github.com/kyverno/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
}