You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to expose Tekton OCI bundle less and mark them as "alpha"
still, let's put their usage under a feature-flag. This will allow us
to experiment, refactor and enhance those without having to support
them nor expose them too much to the end-user.
Enabling the feature gates is a explicit choice for the user and is
documented to make sure users understand this is subject to changes.
This adds a new feature-flags field called "enable-tekton-oci-bundles"
that defaults to false.
If the feature-flag is off, Tekton OCI bundle are not usable. The
admission controller will disallow its usage, and the controller will
not take the bundle field into account.
Note: the e2e tests will be skip on the CI temporarly because we do
not have the *framework* in place to switch feature-flags during
tests. This will be worked out in parallel.
Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
Copy file name to clipboardexpand all lines: docs/install.md
+12-4
Original file line number
Diff line number
Diff line change
@@ -264,7 +264,7 @@ data:
264
264
265
265
## Configuring self-signed cert for private registry
266
266
267
-
The `SSL_CERT_DIR` is set to `/etc/ssl/certs` as the default cert directory. If you are using a self-signed cert for private registry and the cert file is not under the default cert directory, configure your registry cert in the `config-registry-cert` `ConfigMap` with the key `cert`.
267
+
The `SSL_CERT_DIR` is set to `/etc/ssl/certs` as the default cert directory. If you are using a self-signed cert for private registry and the cert file is not under the default cert directory, configure your registry cert in the `config-registry-cert` `ConfigMap` with the key `cert`.
268
268
269
269
## Customizing basic execution parameters
270
270
@@ -303,7 +303,7 @@ file lists the keys you can customize along with their default values.
303
303
To customize the behavior of the Pipelines Controller, modify the ConfigMap `feature-flags` as follows:
304
304
305
305
-`disable-affinity-assistant` - set this flag to `true` to disable the [Affinity Assistant](./workspaces.md#specifying-workspace-order-in-a-pipeline-and-affinity-assistants)
306
-
that is used to provide Node Affinity for `TaskRun` pods that share workspace volume.
306
+
that is used to provide Node Affinity for `TaskRun` pods that share workspace volume.
307
307
The Affinity Assistant is incompatible with other affinity rules
308
308
configured for `TaskRun` pods.
309
309
@@ -326,7 +326,7 @@ for each `Step` that does not have its working directory explicitly set with `/w
326
326
For more information, see the [associated issue](https://github.com/tektoncd/pipeline/issues/1836).
327
327
328
328
-`running-in-environment-with-injected-sidecars`: set this flag to `"true"` to allow the
329
-
Tekton controller to set the `tekton.dev/ready` annotation at pod creation time for
329
+
Tekton controller to set the `tekton.dev/ready` annotation at pod creation time for
330
330
TaskRuns with no Sidecars specified. Enabling this option should decrease the time it takes for a TaskRun to
331
331
start running. However, for clusters that use injected sidecars e.g. istio
332
332
enabling this option can lead to unexpected behavior.
@@ -335,7 +335,15 @@ enabling this option can lead to unexpected behavior.
335
335
Git SSH Secrets include a `known_hosts` field. This ensures that a git remote server's
336
336
key is validated before data is accepted from it when authenticating over SSH. Secrets
337
337
that don't include a `known_hosts` will result in the TaskRun failing validation and
338
-
not running.
338
+
not running.
339
+
340
+
-`enable-tekton-oci-bundles`: set this flag to `"true"` to enable the
341
+
tekton OCI bundle usage (see [the tekton bundle
342
+
contract](./tekton-bundle-contracts.md)). Enabling this option
343
+
allows the use of `bundle` field in `taskRef` and `pipelineRef` for
344
+
`Pipeline`, `PipelineRun` and `TaskRun`. By default, this option is
345
+
disabled (`"false"`), which means it is disallowed to use the
Copy file name to clipboardexpand all lines: docs/pipelineruns.md
+31-26
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ A `PipelineRun` definition supports the following fields:
60
60
object that supplies specific execution credentials for the `Pipeline`.
61
61
-[`serviceAccountNames`](#mapping-serviceaccount-credentials-to-tasks) - Maps specific `serviceAccountName` values
62
62
to `Tasks` in the `Pipeline`. This overrides the credentials set for the entire `Pipeline`.
63
-
-[`taskRunSpec`](#specifying-task-run-specs) - Specifies a list of `PipelineRunTaskSpec` which allows for setting `ServiceAccountName` and [`Pod` template](./podtemplates.md) for each task. This overrides the `Pod` template set for the entire `Pipeline`.
63
+
-[`taskRunSpec`](#specifying-task-run-specs) - Specifies a list of `PipelineRunTaskSpec` which allows for setting `ServiceAccountName` and [`Pod` template](./podtemplates.md) for each task. This overrides the `Pod` template set for the entire `Pipeline`.
64
64
-[`timeout`](#configuring-a-failure-timeout) - Specifies the timeout before the `PipelineRun` fails.
65
65
-[`podTemplate`](#pod-template) - Specifies a [`Pod` template](./podtemplates.md) to use as the basis
66
66
for the configuration of the `Pod` that executes each `Task`.
@@ -70,7 +70,7 @@ A `PipelineRun` definition supports the following fields:
70
70
71
71
### Specifying the target `Pipeline`
72
72
73
-
You must specify the target `Pipeline` that you want the `PipelineRun` to execute, either by referencing
73
+
You must specify the target `Pipeline` that you want the `PipelineRun` to execute, either by referencing
74
74
an existing `Pipeline` definition, or embedding a `Pipeline` definition directly in the `PipelineRun`.
75
75
76
76
To specify the target `Pipeline` by reference, use the `pipelineRef` field:
@@ -81,22 +81,6 @@ spec:
81
81
name: mypipeline
82
82
83
83
```
84
-
85
-
You may also use a `Tekton Bundle` to reference a pipeline defined remotely.
86
-
87
-
```yaml
88
-
spec:
89
-
pipelineRef:
90
-
name: mypipeline
91
-
bundle: docker.io/myrepo/mycatalog:v1.0
92
-
```
93
-
94
-
The syntax and caveats are similar to using `Tekton Bundles` for `Task` references
95
-
in [Pipelines](pipelines.md#tekton-bundles) or [TaskRuns](taskruns.md#tekton-bundles).
96
-
97
-
`Tekton Bundles`may be constructed with any toolsets that produce valid OCI image artifacts
98
-
so long as the artifact adheres to the [contract](tekton-bundle-contracts.md).
99
-
100
84
To embed a `Pipeline` definition in the `PipelineRun`, use the `pipelineSpec` field:
101
85
102
86
```yaml
@@ -156,6 +140,27 @@ spec:
156
140
...
157
141
```
158
142
143
+
#### Tekton Bundles
144
+
145
+
**Note: This is only allowed if `enable-tekton-oci-bundles` is set to
146
+
`"true"`in the `feature-flags` configmap, see [`install.md`](./install.md#customizing-the-pipelines-controller-behavior)**
147
+
148
+
You may also use a `Tekton Bundle` to reference a pipeline defined remotely.
149
+
150
+
```yaml
151
+
spec:
152
+
pipelineRef:
153
+
name: mypipeline
154
+
bundle: docker.io/myrepo/mycatalog:v1.0
155
+
```
156
+
157
+
The syntax and caveats are similar to using `Tekton Bundles` for `Task` references
158
+
in [Pipelines](pipelines.md#tekton-bundles) or [TaskRuns](taskruns.md#tekton-bundles).
159
+
160
+
`Tekton Bundles`may be constructed with any toolsets that produce valid OCI image artifacts
161
+
so long as the artifact adheres to the [contract](tekton-bundle-contracts.md).
162
+
163
+
159
164
## Specifying `Resources`
160
165
161
166
A `Pipeline` requires [`PipelineResources`](resources.md) to provide inputs and store outputs
@@ -223,7 +228,7 @@ to all `persistentVolumeClaims` generated internally.
223
228
You can specify `Parameters` that you want to pass to the `Pipeline` during execution,
224
229
including different values of the same parameter for different `Tasks` in the `Pipeline`.
225
230
226
-
**Note:** You must specify all the `Parameters` that the `Pipeline` expects. Parameters
231
+
**Note:** You must specify all the `Parameters` that the `Pipeline` expects. Parameters
227
232
that have default values specified in Pipeline are not required to be provided by PipelineRun.
228
233
229
234
For example:
@@ -236,14 +241,14 @@ spec:
236
241
- name: pl-param-y
237
242
value: "500"
238
243
```
239
-
You can pass in extra `Parameters` if needed depending on your use cases. An example use
240
-
case is when your CI system autogenerates `PipelineRuns` and it has `Parameters` it wants to
241
-
provide to all `PipelineRuns`. Because you can pass in extra `Parameters`, you don't have to
244
+
You can pass in extra `Parameters` if needed depending on your use cases. An example use
245
+
case is when your CI system autogenerates `PipelineRuns` and it has `Parameters` it wants to
246
+
provide to all `PipelineRuns`. Because you can pass in extra `Parameters`, you don't have to
242
247
go through the complexity of checking each `Pipeline` and providing only the required params.
You can execute the `Pipeline` in your `PipelineRun` with a specific set of credentials by
251
+
You can execute the `Pipeline` in your `PipelineRun` with a specific set of credentials by
247
252
specifying a `ServiceAccount` object name in the `serviceAccountName` field in your `PipelineRun`
248
253
definition. If you do not explicitly specify this, the `TaskRuns` created by your `PipelineRun`
249
254
will execute with the credentials specified in the `configmap-defaults` `ConfigMap`. If this
@@ -256,7 +261,7 @@ For more information, see [`ServiceAccount`](auth.md).
256
261
257
262
If you require more granularity in specifying execution credentials, use the `serviceAccountNames` field to
258
263
map a specific `serviceAccountName` value to a specific `Task` in the `Pipeline`. This overrides the global
259
-
`serviceAccountName`you may have set for the `Pipeline` as described in the previous section.
264
+
`serviceAccountName`you may have set for the `Pipeline` as described in the previous section.
260
265
261
266
For example, if you specify these mappings:
262
267
@@ -358,7 +363,7 @@ spec:
358
363
disktype: ssd
359
364
```
360
365
361
-
If used with this `Pipeline`, `build-task` will use the task specific `PodTemplate` (where `nodeSelector` has `disktype` equal to `ssd`).
366
+
If used with this `Pipeline`, `build-task` will use the task specific `PodTemplate` (where `nodeSelector` has `disktype` equal to `ssd`).
362
367
363
368
### Specifying `Workspaces`
364
369
@@ -474,7 +479,7 @@ When a `PipelineRun` changes status, [events](events.md#pipelineruns) are trigge
474
479
475
480
When a `PipelineRun` has `Tasks` with [WhenExpressions](pipelines.md#guard-task-execution-using-whenexpressions):
476
481
- If the `WhenExpressions` evaluate to `true`, the `Task` is executed then the `TaskRun` and its resolved `WhenExpressions` will be listed in the `Task Runs` section of the `status` of the `PipelineRun`.
477
-
- If the `WhenExpressions` evaluate to `false`, the `Task` is skipped then its name and its resolved `WhenExpressions` will be listed in the `Skipped Tasks` section of the `status` of the `PipelineRun`.
482
+
- If the `WhenExpressions` evaluate to `false`, the `Task` is skipped then its name and its resolved `WhenExpressions` will be listed in the `Skipped Tasks` section of the `status` of the `PipelineRun`.
Copy file name to clipboardexpand all lines: docs/pipelines.md
+22-19
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ A `Pipeline` definition supports the following fields:
45
45
-[`metadata`][kubernetes-overview] - Specifies metadata that uniquely identifies the
46
46
`Pipeline` object. For example, a `name`.
47
47
-[`spec`][kubernetes-overview] - Specifies the configuration information for
48
-
this `Pipeline` object. This must include:
48
+
this `Pipeline` object. This must include:
49
49
-[`tasks`](#adding-tasks-to-the-pipeline) - Specifies the `Tasks` that comprise the `Pipeline`
50
50
and the details of their execution.
51
51
- Optional:
@@ -61,7 +61,7 @@ A `Pipeline` definition supports the following fields:
61
61
execution of a `Task` after a failure. Does not apply to execution cancellations.
62
62
-[`conditions`](#guard-task-execution-using-conditions) - Specifies `Conditions` that only allow a `Task`
63
63
to execute if they successfully evaluate.
64
-
-[`timeout`](#configuring-the-failure-timeout) - Specifies the timeout before a `Task` fails.
64
+
-[`timeout`](#configuring-the-failure-timeout) - Specifies the timeout before a `Task` fails.
65
65
-[`results`](#configuring-execution-results-at-the-pipeline-level) - Specifies the location to which
66
66
the `Pipeline` emits its execution results.
67
67
-[`description`](#adding-a-description) - Holds an informative description of the `Pipeline` object.
@@ -136,7 +136,7 @@ varies throughout its execution. If no value is specified, the `type` field defa
136
136
When the actual parameter value is supplied, its parsed type is validated against the `type` field.
137
137
The `description` and `default` fields for a `Parameter` are optional.
138
138
139
-
The following example illustrates the use of `Parameters` in a `Pipeline`.
139
+
The following example illustrates the use of `Parameters` in a `Pipeline`.
140
140
141
141
The following `Pipeline` declares an input parameter called `context` and passes its
142
142
value to the `Task` to set the value of the `pathToContext` parameter within the `Task`.
@@ -231,6 +231,9 @@ spec:
231
231
232
232
### Tekton Bundles
233
233
234
+
**Note: This is only allowed if `enable-tekton-oci-bundles` is set to
235
+
`"true"`in the `feature-flags` configmap, see [`install.md`](./install.md#customizing-the-pipelines-controller-behavior)**
236
+
234
237
You may also specify your `Task` reference using a `Tekton Bundle`. A `Tekton Bundle` is an OCI artifact that
235
238
contains Tekton resources like `Tasks` which can be referenced within a `taskRef`.
236
239
@@ -244,7 +247,7 @@ contains Tekton resources like `Tasks` which can be referenced within a `taskRef
244
247
```
245
248
246
249
Here, the `bundle` field is the full reference url to the artifact. The name is the
247
-
`metadata.name`field of the `Task`.
250
+
`metadata.name`field of the `Task`.
248
251
249
252
You may also specify a `tag` as you would with a Docker image which will give you a fixed,
250
253
repeatable reference to a `Task`.
@@ -263,7 +266,7 @@ You may also specify a fixed digest instead of a tag.
263
266
```yaml
264
267
spec:
265
268
tasks:
266
-
- name: hello-world
269
+
- name: hello-world
267
270
taskRef:
268
271
name: echo-task
269
272
bundle: docker.io/myrepo/mycatalog@sha256:abc123
@@ -282,14 +285,14 @@ so long as the artifact adheres to the [contract](tekton-bundle-contracts.md).
282
285
283
286
If a `Task` in your `Pipeline` needs to use the output of a previous `Task`
284
287
as its input, use the optional `from` parameter to specify a list of `Tasks`
285
-
that must execute **before** the `Task` that requires their outputs as its
286
-
input. When your target `Task` executes, only the version of the desired
288
+
that must execute **before** the `Task` that requires their outputs as its
289
+
input. When your target `Task` executes, only the version of the desired
287
290
`PipelineResource`produced by the last `Task` in this list is used. The
288
291
`name`of this output `PipelineResource` output must match the `name` of the
289
-
input `PipelineResource` specified in the `Task` that ingests it.
292
+
input `PipelineResource` specified in the `Task` that ingests it.
290
293
291
294
In the example below, the `deploy-app` `Task` ingests the output of the `build-app`
292
-
`Task`named `my-image` as its input. Therefore, the `build-app` `Task` will
295
+
`Task`named `my-image` as its input. Therefore, the `build-app` `Task` will
293
296
execute before the `deploy-app` `Task` regardless of the order in which those
294
297
`Tasks`are declared in the `Pipeline`.
295
298
@@ -377,11 +380,11 @@ The components of `WhenExpressions` are `Input`, `Operator` and `Values`:
377
380
- `Operator`represents an `Input`'s relationship to a set of `Values`. A valid `Operator` must be provided, which can be either `in` or `notin`.
378
381
- `Values`is an array of string values. The `Values` array must be provided and be non-empty. It can contain static values or variables ([`Parameters`](#specifying-parameters), [`Results`](#using-results) or [a Workspaces's `bound` state](#specifying-workspaces)).
379
382
380
-
The [`Parameters`](#specifying-parameters) are read from the `Pipeline` and [`Results`](#using-results) are read directly from previous [`Tasks`](#adding-tasks-to-the-pipeline). Using [`Results`](#using-results) in a `WhenExpression` in a guarded `Task` introduces a resource dependency on the previous `Task` that produced the `Result`.
383
+
The [`Parameters`](#specifying-parameters) are read from the `Pipeline` and [`Results`](#using-results) are read directly from previous [`Tasks`](#adding-tasks-to-the-pipeline). Using [`Results`](#using-results) in a `WhenExpression` in a guarded `Task` introduces a resource dependency on the previous `Task` that produced the `Result`.
381
384
382
-
The declared `WhenExpressions` are evaluated before the `Task` is run. If all the `WhenExpressions` evaluate to `True`, the `Task` is run. If any of the `WhenExpressions` evaluate to `False`, the `Task` is not run and the `Task` is listed in the [`Skipped Tasks` section of the `PipelineRunStatus`](pipelineruns.md#monitoring-execution-status).
385
+
The declared `WhenExpressions` are evaluated before the `Task` is run. If all the `WhenExpressions` evaluate to `True`, the `Task` is run. If any of the `WhenExpressions` evaluate to `False`, the `Task` is not run and the `Task` is listed in the [`Skipped Tasks` section of the `PipelineRunStatus`](pipelineruns.md#monitoring-execution-status).
383
386
384
-
In these examples, `first-create-file` task will only be executed if the `path` parameter is `README.md`, `echo-file-exists` task will only be executed if the `exists` result from `check-file` task is `yes` and `run-lint` task will only be executed if the `lint-config` optional workspace has been provided by a PipelineRun.
387
+
In these examples, `first-create-file` task will only be executed if the `path` parameter is `README.md`, `echo-file-exists` task will only be executed if the `exists` result from `check-file` task is `yes` and `run-lint` task will only be executed if the `lint-config` optional workspace has been provided by a PipelineRun.
385
388
386
389
```yaml
387
390
tasks:
@@ -426,7 +429,7 @@ There are a lot of scenarios where `WhenExpressions` can be really useful. Some
426
429
427
430
### Guard `Task` execution using `Conditions`
428
431
429
-
**Note:** `Conditions` are deprecated, use [`WhenExpressions`](#guard-task-execution-using-whenexpressions) instead.
432
+
**Note:** `Conditions` are deprecated, use [`WhenExpressions`](#guard-task-execution-using-whenexpressions) instead.
430
433
431
434
To run a `Task` only when certain conditions are met, it is possible to _guard_ task execution using
432
435
the `conditions` field. The `conditions` field allows you to list a series of references to
@@ -450,17 +453,17 @@ tasks:
450
453
name: deploy
451
454
```
452
455
453
-
Unlike regular task failures, condition failures do not automatically fail the entire `PipelineRun` --
456
+
Unlike regular task failures, condition failures do not automatically fail the entire `PipelineRun` --
454
457
other tasks that are **not dependent** on the `Task` (via `from` or `runAfter`) are still run.
455
458
456
459
In this example, `(task C)` has a `condition` set to _guard_ its execution. If the condition
457
460
is **not** successfully evaluated, task `(task D)` will not be run, but all other tasks in the pipeline
458
461
that not depend on `(task C)` will be executed and the `PipelineRun` will successfully complete.
459
-
462
+
460
463
```
461
464
(task B) — (task E)
462
-
/
463
-
(task A)
465
+
/
466
+
(task A)
464
467
\
465
468
(guarded task C) — (task D)
466
469
```
@@ -495,7 +498,7 @@ tasks:
495
498
You can use the `Timeout` field in the `Task` spec within the `Pipeline` to set the timeout
496
499
of the `TaskRun` that executes that `Task` within the `PipelineRun` that executes your `Pipeline.`
497
500
The `Timeout` value is a `duration` conforming to Go's [`ParseDuration`](https://golang.org/pkg/time/#ParseDuration)
498
-
format. For example, valid values are `1h30m`, `1h`, `1m`, and `60s`.
501
+
format. For example, valid values are `1h30m`, `1h`, `1m`, and `60s`.
499
502
500
503
**Note:** If you do not specify a `Timeout` value, Tekton instead honors the timeout for the [`PipelineRun`](pipelineruns.md#configuring-a-pipelinerun).
501
504
@@ -528,7 +531,7 @@ a `Result` and another receives it as a `Parameter` with a variable such as
528
531
When one `Task` receives the `Results` of another, there is a dependency created between those
529
532
two `Tasks`. In order for the receiving `Task` to get data from another `Task's` `Result`,
530
533
the `Task` producing the `Result` must run first. Tekton enforces this `Task` ordering
531
-
by ensuring that the `Task` emitting the `Result` executes before any `Task` that uses it.
534
+
by ensuring that the `Task` emitting the `Result` executes before any `Task` that uses it.
532
535
533
536
In the snippet below, a param is provided its value from the `commit` `Result` emitted by the
534
537
`checkout-source``Task`. Tekton will make sure that the `checkout-source` `Task` runs
0 commit comments