-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Improve CEL expression evaluation #253
base: main
Are you sure you want to change the base?
Conversation
Improve CEL expression evaluation by adding further conditions and events. Make the error handling more elaborate to differentiate errors from expected results Signed-off-by: janiskemper <janis.kemper@syself.com>
csov1alpha1.CompileCELExpressionFailedReason, | ||
"failed to compile CEL expression: %s, %s", waitCondition.Conditions, iss.Err(), | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@janiskemper I would add a comment here, why you don't return an error.
"object(%s/%s) from dynamic client for CEL expression is not found: %s", object.Namespace, object.Name, err.Error(), | ||
) | ||
|
||
return false, false, fmt.Errorf("failed to get object(%s/%s) from dynamic client for CEL expression: %w", object.Namespace, object.Name, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@janiskemper is there a reason why both strings are different?
Suggestion:
err2 := fmt.fmt.Errorf("failed to get object(%s/%s) from dynamic client for CEL expression: %w", object.Namespace, object.Name, err)
conditions.MarkFalse(..., err2.Error())
return false, false, err2
Just a comment, not merge blocking.
"failed to evaluate the Ast and environment against the input vars for CEL expression: %s", err.Error(), | ||
) | ||
|
||
return false, false, fmt.Errorf("failed to evaluate the Ast and environment against the input vars for CEL expression: %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@janiskemper the same err2-pattern could be used here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you see a way to test these changes?
yes, by manipulating the clusteraddon.yaml |
What this PR does / why we need it:
Improve CEL expression evaluation by adding further conditions and events. Make the error handling more elaborate to differentiate errors from expected results
Which issue(s) this PR fixes:
Fixes #210
TODOs: