argo-workflows: Unable to reference individual task status in DAG

Summary

What happened/what you expected to happen?

We should be able to reference the status of tasks the same way as referencing steps statuses.

What version of Argo Workflows are you running?

3.2.4

Diagnostics

The workflow is a basically the same as https://github.com/argoproj/argo-workflows/blob/master/examples/exit-handler-with-param.yaml except that I changed to use DAG tasks instead of steps.

Either a workflow that reproduces the bug, or paste you whole workflow YAML, including status, something like:

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  annotations:
    workflows.argoproj.io/description: |
      onExitTemplate enables workflow to pass the arguments (parameters/Artifacts) to exit handler template.
    workflows.argoproj.io/version: '>= 3.1.0'
  creationTimestamp: "2021-12-08T15:18:46Z"
  generateName: exit-handler-with-param-
  generation: 2
  labels:
    workflows.argoproj.io/completed: "true"
    workflows.argoproj.io/phase: Failed
    workflows.argoproj.io/test: "true"
  name: exit-handler-with-param-zqq85
  namespace: argo
  resourceVersion: "205113"
  uid: d2c39061-2c8c-4547-9cac-3e2b7d9d46cc
spec:
  arguments: {}
  entrypoint: first
  serviceAccountName: argo
  templates:
  - dag:
      tasks:
      - arguments: {}
        hooks:
          exit:
            arguments:
              parameters:
              - name: message
                value: '{{tasks.step-1.status}}'
            template: exit
        name: step-1
        template: output
    inputs: {}
    metadata: {}
    name: first
    outputs: {}
  - container:
      args:
      - echo -n hello world > /tmp/hello_world.txt
      command:
      - sh
      - -c
      image: python:alpine3.6
      name: ""
      resources: {}
    inputs: {}
    metadata: {}
    name: output
    outputs:
      parameters:
      - name: result
        valueFrom:
          default: Foobar
          path: /tmp/hello_world.txt
  - inputs:
      parameters:
      - name: message
    metadata: {}
    name: exit
    outputs: {}
    script:
      command:
      - python
      image: python:alpine3.6
      name: ""
      resources: {}
      source: |
        print("{{inputs.parameters.message}}")
status:
  conditions:
  - status: "True"
    type: Completed
  finishedAt: "2021-12-08T15:18:46Z"
  message: 'invalid spec: templates.first.tasks.step-1 failed to resolve {{tasks.step-1.status}}'
  phase: Failed
  progress: 0/0
  startedAt: "2021-12-08T15:18:46Z"

What Kubernetes provider are you using?

What executor are you running? Docker/K8SAPI/Kubelet/PNS/Emissary

PNS

# Logs from the workflow controller:
kubectl logs -n argo deploy/workflow-controller | grep ${workflow}

time="2021-12-08T15:18:46.113Z" level=info msg="Processing workflow" namespace=argo workflow=exit-handler-with-param-zqq85
time="2021-12-08T15:18:46.122Z" level=info msg="Updated phase  -> Failed" namespace=argo workflow=exit-handler-with-param-zqq85
time="2021-12-08T15:18:46.122Z" level=info msg="Updated message  -> invalid spec: templates.first.tasks.step-1 failed to resolve {{tasks.step-1.status}}" namespace=argo workflow=exit-handler-with-param-zqq85
time="2021-12-08T15:18:46.122Z" level=info msg="Marking workflow completed" namespace=argo workflow=exit-handler-with-param-zqq85
time="2021-12-08T15:18:46.123Z" level=error msg="Unable to set ExecWorkflow" error="templates.first.tasks.step-1 failed to resolve {{tasks.step-1.status}}" namespace=argo workflow=exit-handler-with-param-zqq85
time="2021-12-08T15:18:46.123Z" level=info msg="Checking daemoned children of " namespace=argo workflow=exit-handler-with-param-zqq85
time="2021-12-08T15:18:46.136Z" level=info msg="Workflow update successful" namespace=argo phase=Failed resourceVersion=205113 workflow=exit-handler-with-param-zqq85

# The workflow's pods that are problematic:
kubectl get pod -o yaml -l workflows.argoproj.io/workflow=${workflow},workflow.argoproj.io/phase!=Succeeded

# Logs from in your workflow's wait container, something like:
kubectl logs -c wait -l workflows.argoproj.io/workflow=${workflow},workflow.argoproj.io/phase!=Succeeded

Message from the maintainers:

Impacted by this bug? Give it a đź‘Ť. We prioritise the issues with the most đź‘Ť.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 17
  • Comments: 26 (15 by maintainers)

Most upvoted comments

I actually started looking at this yesterday… seems like the validator issue was somehow fixed, but the value still does not get replaced correctly. Working on this today.

@terrytangyuan I will ask @dpadhiar to take a look. He worked on this area for other issues.

@sarabala1979 Anyone available to look into this?

@terrytangyuan Sorry, haven’t gotten a chance. Will try to take a look this week