argoproj / argo-workflows

Workflow Engine for Kubernetes
https://argo-workflows.readthedocs.io/
Apache License 2.0
14.43k stars 3.09k forks source link

When workflow level retry expression evaluated False, workflow message is always `retryStrategy.expression evaluated to false` regardless of actual failure #13058

Open tczhao opened 2 weeks ago

tczhao commented 2 weeks ago

Pre-requisites

What happened/what did you expect to happen?

When workflow level retryExpression is used. regardless of workflow succeed or failure, the message at workflow level is always retryStrategy.expression evaluated to false

when no expression is used

when expression is used

This is problematic if one relies on the workflow message for metrc, analytics or debug. We expect when expression is used, the workflow level message follows the same pattern as normal retry

Version

v3.5.2, latest (https://github.com/argoproj/argo-workflows/commit/71f1d860b2c665ad87e8c313c4f865b829d07626)

Paste a small workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflows that uses private images.

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: dag-nested-
  namespace: argo
spec:
  templates:
    - name: echo
      outputs: {}
      metadata: {}
      container:
        name: ''
        image: alpine:3.7
        command:
          - exit
          - '1'
        resources: {}
    - name: nested-diamond
      outputs: {}
      metadata: {}
      dag:
        tasks:
          - name: A
            template: echo
          - name: B
            template: echo
            depends: A
          - name: C
            template: echo
            depends: A
          - name: D
            template: echo
            depends: B && C
  entrypoint: diamond
  arguments: {}
  retryStrategy:
    retryPolicy: OnError
    expression: >-
      lastRetry.status == 'Errored'

Logs from the workflow controller

kubectl logs -n argo deploy/workflow-controller | grep ${workflow}

Logs from in your workflow's wait container

kubectl logs -n argo -c wait -l workflows.argoproj.io/workflow=${workflow},workflow.argoproj.io/phase!=Succeeded
agilgur5 commented 2 weeks ago

v3.5.8

Did you mean v3.4.8? or v3.5.6? Because the version you wrote doesn't exist right now

tczhao commented 2 weeks ago

Sorry, I was meant to add the commit hash for latest. Nothing to do with x.x.8 Updated