-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Confusingly, when
_kind of_ supports expr expressions
#7576
Comments
Currently |
But it does a little bit. If I write an expression tag template which 1) executes successfully and 2) produces a valid govaluate expression, then the |
This means I can write any expr template which evaluates to For example, |
@crenshaw-dev go-evaluate template format is {{ condition }} Eg.: {{1==1}} |
Kind of, but not precisely. If you used exactly that
|
We should have a new |
Coincidentally, our build infrastructure for Plumbr.ai is trying to use this as well! I have a workaround, but what we open-source won't be too elegant until this - looking forward to it coming soon :) |
@ericmeadows I'm pretty sure the build system I put together at my last job relies on this feature. At the time I assumed it had first-class support. So really hope it doesn't break. 😆 |
@ericmeadows would you like to submit a PR to introduced an alternative to |
@alexec I don't think it's actually necessary to add a new field. Despite what the error message says, For any valid expression producing |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Just a reminder that |
Looks like as of May 2022 the docs indicate expressions are supported for I think the real issue is just that it's a confusing error message. |
It looks like this was explicitly implemented in #9761, which should have also removed the error message entirely |
As such, I'm considering just updating the Conditionals doc to explicitly use |
MetricsError: unable to compute
workflow.status in real-time metrics block with 'when' clause
#12693
Summary
My workflow worked. I expected it to not work. I used the following when expression:
I expected to get an error like this:
Failed to submit workflow: templates.top when expression doesn't support 'expr' format '{{='. 'When' expression is only support govaluate format {{
.But instead, the workflow ran! However, if I introduce a typo to the expression:
I get the above error message as expected. Presumably because the failed expression was not substituted, so the
when
validation logic actually caught its presence.What version of Argo Workflows are you running?
Controller: 3.2.6
CLI: 3.2.3
Diagnostics
This workflow runs without error, even though it seems like it should fail with a validation error.
I'm using docker-desktop k8s with the default executor.
Here's my guess: when the expr expression is valid, it gets executed, and the result is dropped into the
when
field. If the output is a valid govaluate expression, thewhen
logic just treats it as a hard-coded govaluate expression.I'm not really sure how this should be fixed. You could just drop the warning. But an expr expression that doesn't produce a govaluate expression is still invalid. You could document the behavior, but it's really weird to explain. You could add first-class expr support for
when
conditions, but that's a lot of work.Or nothing, and this ticket could serve as documentation of this weird edge case. :-P
Message from the maintainers:
Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.
The text was updated successfully, but these errors were encountered: