argoproj / argoproj/argo-workflows
Continue on specific exit codes
- Dominant language
- Go
- Stars
- 17k
- Forks
- 3.7k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 138
Description
# Summary
Support configuring specific exit codes with `continueOn`.
Could look something like:
```yaml
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: exit-code-output-variable-
spec:
entrypoint: exit-code-output-variable
templates:
- name: exit-code-output-variable
steps:
- - name: failing-container
template: failing-container
continueOn:
exitCode: 3
- - name: echo-container
template: echo-container
arguments:
parameters:
- name: exitCode
value: "{{steps.failing-container.exitCode}}"
- name: failing-container
container:
image: alpine:3.6
command: [sh, -c]
args: ["exit 123"]
- name: echo-container
inputs:
parameters:
- name: exitCode
container:
image: alpine:3.6
command: [sh, -c]
args: ["echo \"Exit code was: {{inputs.parameters.exitCode}}\""]
```
# Use Cases
I have a container that can return a custom exit code. I would only like the workflow to continue if the exit code matches that, I don't want it to continue for any other failure.
---
**Message from the maintainers**:
Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.
Contributor guide
Research direction
The issue provides a Workflow YAML example but names no repository files, tests, or entry points. Start by tracing the existing `continueOn` handling and exit-code propagation; done means workflows continue only for the configured exit code and preserve the exit code for later parameter use.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- backend, devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100