forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-on-exit.yaml
40 lines (37 loc) · 1.42 KB
/
template-on-exit.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
# Example showing a Step with an onExit template. The onExit template ("exitContainer")
# will run after the parent ("whalesay"), regardless of if it fails or succeeds.
# This is also similarly possible with DAG Tasks
#
# STEP PODNAME DURATION MESSAGE
# ✔ container-on-exit-m6wq5 (step-template)
# ├---✔ stepA (whalesay) container-on-exit-m6wq5-3072376347 4s
# ├-✔ stepA.onExit (exitContainer) container-on-exit-m6wq5-2711812994 4s
# ├---✔ stepB (whalesay) container-on-exit-m6wq5-2803967195 5s
# └-✔ stepB.onExit (exitContainer) container-on-exit-m6wq5-22494146 4s
#
# Template onExit containers work for all templates: DAG, Steps, Container, Script, Suspend, and Resource.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: container-on-exit-
spec:
entrypoint: step-template
templates:
- name: step-template
steps:
- - name: stepA
onExit: exitContainer
template: whalesay
- - name: stepB
onExit: exitContainer
template: whalesay
- name: whalesay
container:
image: docker/whalesay
command: [cowsay]
args: ["hello world"]
- name: exitContainer
container:
image: docker/whalesay
command: [cowsay]
args: ["goodbye world"]