Skip to content

Commit

Permalink
updating example of a matrix feature
Browse files Browse the repository at this point in the history
Adding two new validation:

* onError with matrix: when a task fan out for a given number of instances,
pipeline controller must apply the onError to each running instance.

* retry with matrix: when a task has specified retry, that specification
must apply to all the instances of fanned out task.

Signed-off-by: Priti Desai <pdesai@us.ibm.com>
  • Loading branch information
pritidesai committed Aug 23, 2023
1 parent 2299b15 commit d852d1d
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions examples/v1/pipelineruns/alpha/pipelinerun-with-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,46 @@ spec:
- name: echo
image: ubuntu
script: exit 1
- name: matrix-with-task-using-onerror
matrix:
params:
- name: version
value:
- "1"
- "2"
taskSpec:
params:
- name: version
steps:
- name: echo
image: ubuntu
onError: continue
script: exit 1
- name: matrix-with-task-retries
retries: 1
params:
- name: pipelineTask-retries
value: $(context.pipelineTask.retries)
matrix:
params:
- name: version
value:
- "1"
- "2"
taskSpec:
params:
- name: version
- name: pipelineTask-retries
steps:
- image: alpine
script: |
#!/usr/bin/env sh
if [ "$(context.task.retry-count)" == "$(params.pipelineTask-retries)" ]; then
echo "This is the last retry."
exit 0;
fi
echo "The PipelineTask has retried $(context.task.retry-count) times."
exit 1
finally:
- name: matrix-params-with-empty-array-skipped-in-finally
matrix:
Expand Down

0 comments on commit d852d1d

Please sign in to comment.