Mark Argo workflow step as skipped based on the step's own output

1.1k views Asked by At

I know that I can refer the output of previous steps to skip another step. Is it possible in argo to mark a step as skipped based on its output?

I am looking for something like this. This would not work but what would be an alternative?

steps:
- - name: hello1
    template: echo
    when: "{{steps.hello1.outputs.result}} != hello1"
    arguments:
      parameters:
      - name: message
        value: hello1
1

There are 1 answers

0
crenshaw-dev On BEST ANSWER

There is no way to mark a step as skipped based on its own output.

When a step is "marked as skipped" (in the UI, in its internal representation in Kubernetes, etc.) it's not simply being marked. The mark is an expression of the fact that the step was, in fact, skipped.

In order to read the output of hello1, you must first run hello1 - at which point it is not, in fact, skipped.

If you are executing hello1 more than once (recursively), then future iterations may be conditioned on the output of past iterations. That's the basis of Argo's coinflip-recursive example which "flips a coin" until the flip comes up heads.