-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Error with expr from parameter output another step #8911
Comments
@DiegoFlop can you try without when: "jsonpath(tasks.checkout.outputs.parameters.custom_config, '$.steps.test_unit.skip') == 'false'" |
Hi, @sarabala1979
The field 'checkout' is the first step of workflow. I changed my workflow for execute a python script to export multiple file as output parameters and so this I can continue to another step, but this make that more complex. Really, I would like the use of output parameters from other steps to work correctly in the "when" clause. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is a mentoring request, please provide an update here. Thank you for your contributions. |
crunchy |
Any idea how to solve this? |
@DiegoFlop let me look this and update you |
@dpadhiar Can you look at this issue? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is a mentoring request, please provide an update here. Thank you for your contributions. |
Any news on this issue? |
Is it any plan fix this issue? 🙏 |
@DiegoFlop could you please share with us workaround that you mentioned above? Thank you in advance 🤗 |
@vermaxik In my case only use this feature to skip steps. During firts step I create a config file, however with expr doesn't work for my case. But how I only need get if boolean attribute is True or False, I create others files only with this attribute value. Example: step0 apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: step0
spec:
entrypoint: main
templates:
- name: main
inputs:
parameters:
- name: git_ssh_url
- name: BRANCH
artifacts:
- name: git-clone
path: "/workspace/project"
git:
revision: "{{inputs.parameters.BRANCH}}"
repo: "{{inputs.parameters.git_ssh_url}}"
singleBranch: false
sshPrivateKeySecret:
name: github
key: id_rsa
insecureIgnoreHostKey: true
optional: true
outputs:
parameters:
- name: custom
valueFrom:
path: "/workspace/custom.json"
- name: step1_skip
description: "Skip step1 step"
valueFrom:
path: "/tmp/step1_skip"
- name: step2_skip
description: "Skip step2 step"
valueFrom:
path: "/tmp/step2_skip"
container:
imagePullPolicy: Always
image: xxxxxxx:1.0.0
workingDir: "/workspace/project"
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 200m
memory: 256Mi
command:
- "python"
args:
- "/my-script.py"
- "param1" main workflow apiVersion: argoproj.io/v1alpha1
kind: ClusterWorkflowTemplate
metadata:
name: pipeline
spec:
entrypoint: main
templates:
- name: main
dag:
tasks:
- name: step0
templateRef:
name: step0
template: main
arguments:
parameters:
- name: git_ssh_url
value: "XXXXXXXXXX"
- name: BRANCH
value: "XXXXXXXXX"
- name: step1
templateRef:
name: step1
template: main
depends: "step0"
when: "{{tasks.checkout.outputs.parameters.step0_skip}} =~ '^(false|False)$'"
.... |
@DiegoFlop Core Argo team is busy with 3.4 feature completion. We will take a look at this issue once we have completed the feature work. do you like to contribute to fixing this issue? |
@sarabala1979 |
@DiegoFlop are you working on it? Can I get ETA for this? |
@DiegoFlop Can you provide me a full set of files I can use to reproduce this on my end? I might be missing something but in the first example, I don't believe it includes the WorkflowTemplate "checkout" or "unit-test" being referenced. Also, "tasks.checkout.outputs.parameters.custom_config" is referenced but I don't see that output parameter defined. In the second example I don't think your "step1" WorkflowTemplate is included, right? And "tasks.checkout" is referenced but I don't see that task. |
I spoke to my colleague, and currently expr expressions are not supported for when conditions. We will open an Enhancement Issue related to that instead, and I can post the link here. Please let us know if there is something that you can only do with expr and can't do with govaluate. |
Added this issue, which as I've been told was the actual root cause behind why the validation logic prevents expr expressions in the "when" condition. |
I think the fix for this would be to revert c29b275. It is that validation that is preventing its use. |
It is trivial |
Please see the PR - I have reverted it and fixed the underlying cause based on discussion with Bala |
Checklist
Summary
What happened/what you expected to happen?
When on a when field add an expr with output task I get the next error:
the expr I'm using is:
However when I use and input parameter with expr everything works correctly, but I don't have use an input parameter because, I need use the output parameter to another task and I get a json file.
Which this expr works correctly
What version are you running?
Argo-workflows: 3.3.6
Kubernetes: 1.22.9
Diagnostics
Paste the smallest workflow that reproduces the bug. We must be able to run the workflow.
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: