Skip to content

Using when expression to parse result leads to error #13880

Answered by jswxstw
Zujiry asked this question in Q&A
Discussion options

You must be logged in to vote

Note: a dash in the name requires the use of brackets and quotes for expr to handle.

apiVersion: argoproj.io/v1alpha1
kind: ClusterWorkflowTemplate
metadata:
  name: wft-if-else
spec:
  templates:
  - name: run-task-wft
    steps:
    - - name: step-first   # <- this writes the aforementioned output
    - - name: step-if-one
        when: "1 == {{=jsonpath(steps['step-first'].outputs.parameters.result, '$.result')}}"
    - - name: step-if-zero
        when: "0 == {{=jsonpath(steps['step-first'].outputs.parameters.result, '$.result')}}"

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Zujiry
Comment options

Answer selected by Zujiry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area/templating Templating with `{{...}}` type/support User support issue - likely not a bug
2 participants