mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
22 lines
363 B
Go
22 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
|
||
|
}
|