Skip to content

Commit 145043a

Browse files
rguichardtekton-robot
authored andcommitted
docs(pipelines): specify how to reference an array parameter
1 parent b7fa888 commit 145043a

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

docs/pipelines.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,12 @@ The `description` and `default` fields for a `Parameter` are optional.
161161

162162
The following example illustrates the use of `Parameters` in a `Pipeline`.
163163

164-
The following `Pipeline` declares an input parameter called `context` and passes its
165-
value to the `Task` to set the value of the `pathToContext` parameter within the `Task`.
164+
The following `Pipeline` declares two input parameters :
165+
166+
- `context` which passes its value (a string) to the `Task` to set the value of the `pathToContext` parameter within the `Task`.
167+
- `flags` which passes its value (an array) to the `Task` to set the value of
168+
the `flags` parameter within the `Task`. The `flags` parameter within the
169+
`Task` **must** also be an array.
166170
If you specify a value for the `default` field and invoke this `Pipeline` in a `PipelineRun`
167171
without specifying a value for `context`, that value will be used.
168172

@@ -180,6 +184,9 @@ spec:
180184
type: string
181185
description: Path to context
182186
default: /some/where/or/other
187+
- name: flags
188+
type: array
189+
description: List of flags
183190
tasks:
184191
- name: build-skaffold-web
185192
taskRef:
@@ -189,6 +196,8 @@ spec:
189196
value: Dockerfile
190197
- name: pathToContext
191198
value: "$(params.context)"
199+
- name: flags
200+
value: ["$(params.flags[*])"]
192201
```
193202

194203
The following `PipelineRun` supplies a value for `context`:
@@ -204,6 +213,10 @@ spec:
204213
params:
205214
- name: "context"
206215
value: "/workspace/examples/microservices/leeroy-web"
216+
- name: "flags"
217+
value:
218+
- "foo"
219+
- "bar"
207220
```
208221

209222
## Adding `Tasks` to the `Pipeline`
@@ -1021,7 +1034,7 @@ If the `WhenExpressions` in a `Finally Task` use `Results` from a skipped or fai
10211034

10221035
#### `WhenExpressions` using `Execution Status` of `PipelineTask` in `Finally Tasks`
10231036

1024-
`WhenExpressions` in `Finally Tasks` can utilize [`Execution Status` of `PipelineTasks`](#using-execution-status-of-pipelinetask),
1037+
`WhenExpressions` in `Finally Tasks` can utilize [`Execution Status` of `PipelineTasks`](#using-execution-status-of-pipelinetask),
10251038
as demonstrated using [`golang-build`](https://github.com/tektoncd/catalog/tree/main/task/golang-build/0.1) and
10261039
[`send-to-channel-slack`](https://github.com/tektoncd/catalog/tree/main/task/send-to-channel-slack/0.1) Catalog `Tasks`:
10271040

@@ -1139,7 +1152,7 @@ For example, a custom task might execute some operation outside of the cluster a
11391152

11401153
A PipelineRun starts a custom task by creating a [`Run`](https://github.com/tektoncd/pipeline/blob/main/docs/runs.md) instead of a `TaskRun`.
11411154
In order for a custom task to execute, there must be a custom task controller running on the cluster
1142-
that is responsible for watching and updating `Run`s which reference their type.
1155+
that is responsible for watching and updating `Run`s which reference their type.
11431156
If no such controller is running, those `Run`s will never complete and Pipelines using them will time out.
11441157

11451158
Custom tasks are an **_experimental alpha feature_** and should be expected to change

0 commit comments

Comments
 (0)