-
I want to specify a global exit handler: when all workflows ends, the exit handler should be executed. I read this doc: https://argoproj.github.io/argo-workflows/default-workflow-specs/ workflowDefaults: |
spec:
onExit: exit-handler
templates:
- name: exit-handler
steps:
- - name: job-success
template: send-ok-noti
when: "{{workflow.status}} == Succeeded"
- name: job-fail
template: send-fail-noti
when: "{{workflow.status}} != Succeeded"
- name: send-ok-noti
container:
image: 'some_image'
env:
- name: MESSAGE
value: "{{workflow.name}} succeeded!"
- name: send-fail-noti
container:
image: 'some_image'
env:
- name: MESSAGE
value: "{{workflow.name}} failed!" An error like How can I do this? I think this may be possible because https://argoproj.github.io/argo-workflows/workflow-notifications/ mentions about this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I asked this in Slack, 'Hong Wang' gave me good answer. workflowDefaults: |
spec:
onExit: exit-handler
templates:
- name: exit-handler
steps:
- - name: job-success
template: send-ok-noti
when: "{{workflow.status}} == Succeeded"
- name: job-fail
template: send-fail-noti
when: "{{workflow.status}} != Succeeded"
- name: send-ok-noti
container:
image: 'some_image'
env:
- name: MESSAGE
value: "{{workflow.name}} succeeded!"
- name: send-fail-noti
container:
image: 'some_image'
env:
- name: MESSAGE
value: "{{workflow.name}} failed!" |
Beta Was this translation helpful? Give feedback.
I asked this in Slack, 'Hong Wang' gave me good answer.
I should place
templates
section nested intospec
.