-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
DAG tasks that use withItems are always seen as 'Succeeded' even when skipped #3378
Comments
@simster7 could you investigate in case this is due to DAG changes? |
btw, here is the yaml of the executed workflow. A(0:bar:foo,foo:bar) is set to Skipped but its parent TaskGroup A is set to Succeeded.
|
This is actually the current expected behavior. In the example you posted, task apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
name: test
spec:
entrypoint: dag
templates:
- name: dag
dag:
tasks:
- name: A
template: whalesay
arguments:
parameters:
- name: message
value: "{{item}}"
withItems:
- "bar"
- "foo"
when: "foo == {{item}}" # note that the `when` clause actually depends on the `{{item}}`
- name: B
depends: "A.Succeeded"
template: whalesay
arguments:
parameters:
- name: message
value: "B"
- name: whalesay
inputs:
parameters:
- name: message
container:
image: docker/whalesay:latest
command: [cowsay]
args: ["{{inputs.parameters.message}}"] In this workflow, only certain on the children spawned by
This being said, when you use Possible things to consider to solve this:
I will bring this up and discuss it with the team and report back. |
This is unrelated to the DAG changes. |
label as |
Hi @mark9white, I just spoke with the team. We found a workaround for your current use case: simply rest the template into a deeper call and leave the apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
name: test
spec:
entrypoint: dag
templates:
- name: dag
dag:
tasks:
- name: A
template: call-loop
when: "1 == 1"
- name: B
depends: "A.Succeeded"
template: whalesay
arguments:
parameters:
- name: message
value: "B"
- name: call-loop
steps:
- - name: A
template: whalesay
arguments:
parameters:
- name: message
value: "{{item}}"
withItems:
- foo: "bar"
bar: "foo"
- name: whalesay
inputs:
parameters:
- name: message
container:
image: docker/whalesay:latest
command: [cowsay]
args: ["{{inputs.parameters.message}}"] With regards to being able to select for |
Checklist:
What happened:
If you have a DAG task with a 'false' when condition (so it will be skipped), and it uses withItems to pass a map into it, then it will be seen by its dependencies as 'Succeeded'.
What you expected to happen:
DAG tasks with a false when condition to always be seen as 'Skipped'.
How to reproduce it (as minimally and precisely as possible):
I would expect this workflow to skip task B, but instead it runs it.
Anything else we need to know?:
Environment:
Other debugging information (if applicable):
Message from the maintainers:
If you are impacted by this bug please add a 👍 reaction to this issue! We often sort issues this way to know what to prioritize.
The text was updated successfully, but these errors were encountered: