forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added status of previous steps as variables (argoproj#1681)
- Loading branch information
1 parent
ad3dd4d
commit 09a6cb4
Showing
7 changed files
with
454 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# The status reference example combines the use of a status result, | ||
# along with conditionals, to take a dynamic path in the | ||
# workflow. In this example, depending on the status of 'flakey-container' | ||
# the template will either run the 'succeeded' step or the 'failed' step. | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
generateName: status-reference- | ||
spec: | ||
entrypoint: status-reference | ||
templates: | ||
- name: status-reference | ||
steps: | ||
- - name: flakey-container | ||
template: flakey-container | ||
continueOn: | ||
failed: true | ||
- - name: failed | ||
template: failed | ||
when: "{{steps.flakey-container.status}} == Failed" | ||
- name: succeeded | ||
template: succeeded | ||
when: "{{steps.flakey-container.status}} == Succeeded" | ||
|
||
- name: flakey-container | ||
script: | ||
image: alpine:3.6 | ||
command: [sh, -c] | ||
args: ["exit 1"] | ||
|
||
- name: failed | ||
container: | ||
image: alpine:3.6 | ||
command: [sh, -c] | ||
args: ["echo \"the flakey container failed\""] | ||
|
||
- name: succeeded | ||
container: | ||
image: alpine:3.6 | ||
command: [sh, -c] | ||
args: ["echo \"the flakey container passed\""] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.