forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexit-handler-with-param.yaml
46 lines (44 loc) · 1.32 KB
/
exit-handler-with-param.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
36
37
38
39
40
41
42
43
44
45
46
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: exit-handler-with-param-
labels:
workflows.argoproj.io/test: "true"
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'
spec:
entrypoint: main
templates:
- name: main
steps:
- - name: step-1
template: output
hooks:
exit:
template: exit
arguments:
parameters:
- name: message
value: "{{steps.step-1.outputs.parameters.result}}"
- name: output
container:
image: python:alpine3.6
command: [sh, -c]
args: ["echo -n hello world > /tmp/hello_world.txt"]
outputs:
parameters:
- name: result
valueFrom:
default: "Foobar" # Default value to use if retrieving valueFrom fails. If not provided workflow will fail instead
path: /tmp/hello_world.txt
- name: exit
inputs:
parameters:
- name: message
script:
image: python:alpine3.6
command: [ python ]
source: |
print("{{inputs.parameters.message}}")