Skip to content

Commit

Permalink
align param reference as a whole in 0076 and 0075 to address tektoncd…
Browse files Browse the repository at this point in the history
  • Loading branch information
ywluogg committed May 17, 2022
1 parent c376f79 commit 395dcad
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions teps/0076-array-result-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,27 @@ tasks:
Additionally, array results can be passed directly to Tasks which take arrays as parameters using
[the `[*]` variable replacement syntax](https://github.com/tektoncd/pipeline/blob/main/docs/tasks.md#substituting-array-parameters).

For example:

For example, when params `update-all-environments` in array type is substituted with another array type `tasks.get-environments.results.environments`:
```yaml
apiVersion: tekton.dev/v1beta1
kind: Pipeline
...
spec:
tasks:
- name: update-all-environments
params:
- name: environments
value: $(tasks.get-environments.results.environments[*])
```
What we will get will be:
```
params:
- name: environments
value:
- 'value1'
- 'value2'
```
Another example will be thw following if `tasks.get-environments.results.environments` and `environments` are both arrays of strings:
```yaml
apiVersion: tekton.dev/v1beta1
kind: Pipeline
Expand All @@ -466,6 +485,7 @@ tasks:
value: '$(tasks.get-environments.results.environments[*])'
```


## Test Plan

In addition to unit tests the implementation would include:
Expand Down

0 comments on commit 395dcad

Please sign in to comment.