add arbitrary expression to CelExpression#115
Conversation
Signed-off-by: zirain <[email protected]>
Signed-off-by: zirain <[email protected]>
Signed-off-by: zirain <[email protected]>
| cel.expr.CheckedExpr cel_expr_checked = 4; | ||
|
|
||
| // Expression in abstract syntax tree (AST) form. | ||
| // This's useful when there's no control plane(e.g. XDS from file). |
There was a problem hiding this comment.
Sorry, I don't fully understand what's the realtionship between having a dynamic control-plane and having it in a file.
Can you shed some light here?
Also, are there any constraints for this field, or is there some format that needs to be used?
Will a generic string, e.g. "abc", make sense in this case?
There was a problem hiding this comment.
Previous context is here, suggested by @yanavlasov.
I agree with that it's hard to send cel.expr.CheckedExpr when uses using file for xds instead of a control plane, or maybe I missed something.
There was a problem hiding this comment.
it's a little painful to write something like following:
expression:
parsed_expr:
expr:
id: 4
call_expr:
function: _!=_
args:
- id: 3
select_expr:
field: id
operand:
id: 2
select_expr:
field: node
operand:
id: 1
ident_expr:
name: xds
- id: 5
const_expr:
string_value: "node_name"There was a problem hiding this comment.
The use case is simple deployment or tests where it is easier to make Envoy parse the CEL expression, rather than having to specify the AST proto.
There was a problem hiding this comment.
I agree it's easier, but it is unclear what the format that is used here (perhaps add a link).
FWIW, I hope it is being validated, and the config is rejected if the string is invalid.
this's suggested by @yanavlasov in envoyproxy/envoy#38182 (comment)
it's useful in envoy when there's no control plane.
cc @yanavlasov @htuch