fix: rename and/or to all/any

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso
2025-04-25 10:52:45 -04:00
parent 65cbc6922c
commit 92a3e5ba81
10 changed files with 41 additions and 29 deletions

View File

@@ -28,18 +28,23 @@ func NewCELChecker(cfg *config.ExpressionOrList) (*CELChecker, error) {
if cfg.Expression != "" {
src = cfg.Expression
var iss *cel.Issues
ast, iss = env.Compile(src)
interm, iss := env.Compile(src)
if iss != nil {
return nil, iss.Err()
}
ast, iss = env.Check(interm)
if iss != nil {
return nil, iss.Err()
}
}
if len(cfg.And) != 0 {
ast, err = expressions.Join(env, expressions.JoinAnd, cfg.And...)
if len(cfg.All) != 0 {
ast, err = expressions.Join(env, expressions.JoinAnd, cfg.All...)
}
if len(cfg.Or) != 0 {
ast, err = expressions.Join(env, expressions.JoinOr, cfg.Or...)
if len(cfg.Any) != 0 {
ast, err = expressions.Join(env, expressions.JoinOr, cfg.Any...)
}
if err != nil {