forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conditionals.yaml
35 lines (33 loc) · 1.05 KB
/
conditionals.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Conditionals provide a way to affect the control flow of a
# workflow at runtime, depending on parameters. In this example
# the 'print-hello' template may or may not be executed depending
# on the input parameter, 'should-print'. When submitted with:
# argo submit examples/conditionals.yaml
# the step will be skipped since 'should-print' will evaluate false.
# When submitted with:
# argo submit examples/conditionals.yaml -p should-print=true
# the step will be executed since 'should-print' will evaluate true.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: conditional-
spec:
entrypoint: conditional-example
arguments:
parameters:
- name: should-print
value: "false"
templates:
- name: conditional-example
inputs:
parameters:
- name: should-print
steps:
- - name: print-hello
template: whalesay
when: "{{inputs.parameters.should-print}} == true"
- name: whalesay
container:
image: docker/whalesay:latest
command: [sh, -c]
args: ["cowsay hello"]