mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
6d9d3b7f4c
* 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>
21 lines
362 B
Go
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
|
|
}
|