Skip to content

Commit fe47c9b

Browse files
Yongxuanzhangtekton-robot
authored andcommitted
TEP-0075(object params and results) promoted to stable
Pipeline 0.46 introduced object params and results. This commit is promoting TEP-0075 to stable such that these features can be used by the task authors and pipeline authors in a cluster when enable-api-fields is alpha,beta or stable. Signed-off-by: Yongxuan Zhang yongxuanzhang@google.com
1 parent 8ad2da9 commit fe47c9b

28 files changed

+80
-615
lines changed

docs/additional-configs.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,6 @@ Features currently in "beta" are:
334334
| Feature | Proposal | Alpha Release | Beta Release | Individual Flag |
335335
|:------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------|:---------------------------------------------------------------------|:------------------------------|
336336
| [Array Results and Array Indexing](pipelineruns.md#specifying-parameters) | [TEP-0076](https://github.com/tektoncd/community/blob/main/teps/0076-array-result-types.md) | [v0.38.0](https://github.com/tektoncd/pipeline/releases/tag/v0.38.0) | [v0.45.0](https://github.com/tektoncd/pipeline/releases/tag/v0.45.0) | |
337-
| [Object Parameters and Results](pipelineruns.md#specifying-parameters) | [TEP-0075](https://github.com/tektoncd/community/blob/main/teps/0075-object-param-and-result-types.md) | | [v0.46.0](https://github.com/tektoncd/pipeline/releases/tag/v0.46.0) | |
338337
| [Remote Tasks](./taskruns.md#remote-tasks) and [Remote Pipelines](./pipelineruns.md#remote-pipelines) | [TEP-0060](https://github.com/tektoncd/community/blob/main/teps/0060-remote-resolution.md) | | [v0.41.0](https://github.com/tektoncd/pipeline/releases/tag/v0.41.0) | |
339338
| [`Provenance` field in Status](pipeline-api.md#provenance) | [issue#5550](https://github.com/tektoncd/pipeline/issues/5550) | [v0.41.0](https://github.com/tektoncd/pipeline/releases/tag/v0.41.0) | [v0.48.0](https://github.com/tektoncd/pipeline/releases/tag/v0.48.0) | `enable-provenance-in-status` |
340339
| [Isolated `Step` & `Sidecar` `Workspaces`](./workspaces.md#isolated-workspaces) | [TEP-0029](https://github.com/tektoncd/community/blob/main/teps/0029-step-workspaces.md) | [v0.24.0](https://github.com/tektoncd/pipeline/releases/tag/v0.24.0) | [v0.50.0](https://github.com/tektoncd/pipeline/releases/tag/v0.50.0) | |

docs/pipelineruns.md

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ weight: 204
1919
- [Propagated Parameters](#propagated-parameters)
2020
- [Scope and Precedence](#scope-and-precedence)
2121
- [Default Values](#default-values)
22-
- [Object Parameters](#object-parameters)
22+
- [Object Parameters](#object-parameters)
2323
- [Specifying custom <code>ServiceAccount</code> credentials](#specifying-custom-serviceaccount-credentials)
2424
- [Mapping <code>ServiceAccount</code> credentials to <code>Tasks</code>](#mapping-serviceaccount-credentials-to-tasks)
2525
- [Specifying a <code>Pod</code> template](#specifying-a-pod-template)
@@ -71,12 +71,12 @@ A `PipelineRun` definition supports the following fields:
7171
- [`params`](#specifying-parameters) - Specifies the desired execution parameters for the `Pipeline`.
7272
- [`serviceAccountName`](#specifying-custom-serviceaccount-credentials) - Specifies a `ServiceAccount`
7373
object that supplies specific execution credentials for the `Pipeline`.
74-
- [`status`](#cancelling-a-pipelinerun) - Specifies options for cancelling a `PipelineRun`.
74+
- [`status`](#cancelling-a-pipelinerun) - Specifies options for cancelling a `PipelineRun`.
7575
- [`taskRunSpecs`](#specifying-taskrunspecs) - Specifies a list of `PipelineRunTaskSpec` which allows for setting `ServiceAccountName`, [`Pod` template](./podtemplates.md), and `Metadata` for each task. This overrides the `Pod` template set for the entire `Pipeline`.
7676
- [`timeout`](#configuring-a-failure-timeout) - Specifies the timeout before the `PipelineRun` fails. `timeout` is deprecated and will eventually be removed, so consider using `timeouts` instead.
7777
- [`timeouts`](#configuring-a-failure-timeout) - Specifies the timeout before the `PipelineRun` fails. `timeouts` allows more granular timeout configuration, at the pipeline, tasks, and finally levels
7878
- [`podTemplate`](#specifying-a-pod-template) - Specifies a [`Pod` template](./podtemplates.md) to use as the basis for the configuration of the `Pod` that executes each `Task`.
79-
- [`workspaces`](#specifying-workspaces) - Specifies a set of workspace bindings which must match the names of workspaces declared in the pipeline being used.
79+
- [`workspaces`](#specifying-workspaces) - Specifies a set of workspace bindings which must match the names of workspaces declared in the pipeline being used.
8080

8181
[kubernetes-overview]:
8282
https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/#required-fields
@@ -233,7 +233,7 @@ spec:
233233
apiVersion: tekton.dev/v1 # or tekton.dev/v1beta1
234234
kind: PipelineRun
235235
metadata:
236-
name: pipelinerun
236+
name: pipelinerun
237237
spec:
238238
pipelineRef:
239239
name: pipeline
@@ -275,9 +275,9 @@ go through the complexity of checking each `Pipeline` and providing only the req
275275

276276
> :seedling: **`enum` is an [alpha](additional-configs.md#alpha-features) feature.** The `enable-param-enum` feature flag must be set to `"true"` to enable this feature.
277277

278-
If a `Parameter` is guarded by `Enum` in the `Pipeline`, you can only provide `Parameter` values in the `PipelineRun` that are predefined in the `Param.Enum` in the `Pipeline`. The `PipelineRun` will fail with reason `InvalidParamValue` otherwise.
278+
If a `Parameter` is guarded by `Enum` in the `Pipeline`, you can only provide `Parameter` values in the `PipelineRun` that are predefined in the `Param.Enum` in the `Pipeline`. The `PipelineRun` will fail with reason `InvalidParamValue` otherwise.
279279

280-
Tekton will also the validate the `param` values passed to any referenced `Tasks` (via `taskRef`) if `Enum` is specified for the `Task`. The `PipelineRun` will fail with reason `InvalidParamValue` if `Enum` validation is failed for any of the `PipelineTask`.
280+
Tekton will also the validate the `param` values passed to any referenced `Tasks` (via `taskRef`) if `Enum` is specified for the `Task`. The `PipelineRun` will fail with reason `InvalidParamValue` if `Enum` validation is failed for any of the `PipelineTask`.
281281

282282
You can also specify `Enum` in an embedded `Pipeline` in a `PipelineRun`. The same `Param` validation will be executed in this scenario.
283283

@@ -579,43 +579,41 @@ status:
579579

580580
##### Object Parameters
581581

582-
Object params is a [beta feature](./additional-configs.md#beta-features).
583-
584582
When using an inlined spec, object parameters from the parent `PipelineRun` will also be
585583
propagated to any inlined specs without needing to be explicitly defined. This
586584
allows authors to simplify specs by automatically propagating top-level
587585
parameters down to other inlined resources.
588586
When propagating object parameters, scope and precedence also holds as shown below.
589-
587+
590588
```yaml
591-
apiVersion: tekton.dev/v1 # or tekton.dev/v1beta1
592-
kind: PipelineRun
589+
apiVersion: tekton.dev/v1 # or tekton.dev/v1beta1
590+
kind: PipelineRun
593591
metadata:
594-
generateName: pipelinerun-object-param-result
592+
generateName: pipelinerun-object-param-result
595593
spec:
596594
params:
597-
- name: gitrepo
598-
value:
599-
url: abc.com
600-
commit: sha123
601-
pipelineSpec:
602-
tasks:
603-
- name: task1
604-
params:
605-
- name: gitrepo
595+
- name: gitrepo
596+
value:
597+
url: abc.com
598+
commit: sha123
599+
pipelineSpec:
600+
tasks:
601+
- name: task1
602+
params:
603+
- name: gitrepo
606604
value:
607-
branch: main
608-
url: xyz.com
605+
branch: main
606+
url: xyz.com
609607
taskSpec:
610608
steps:
611-
- name: write-result
612-
image: bash
613-
args: [
614-
"echo",
615-
"--url=$(params.gitrepo.url)",
609+
- name: write-result
610+
image: bash
611+
args: [
612+
"echo",
613+
"--url=$(params.gitrepo.url)",
616614
"--commit=$(params.gitrepo.commit)",
617615
"--branch=$(params.gitrepo.branch)",
618-
]
616+
]
619617
```
620618

621619
resolves to
@@ -650,7 +648,7 @@ spec:
650648
- --commit=$(params.gitrepo.commit)
651649
- --branch=$(params.gitrepo.branch)
652650
image: bash
653-
name: write-result
651+
name: write-result
654652
status:
655653
completionTime: "2022-09-08T17:22:01Z"
656654
conditions:
@@ -784,7 +782,7 @@ spec:
784782
args:
785783
- echo "1001" | tee $(results.uid.path)
786784
- name: show-uid
787-
# params:
785+
# params:
788786
# - name: uid
789787
# value: $(tasks.add-uid.results.uid)
790788
taskSpec:
@@ -885,7 +883,7 @@ metadata:
885883
spec:
886884
pipelineRef:
887885
name: mypipeline
888-
taskRunTemplate:
886+
taskRunTemplate:
889887
podTemplate:
890888
securityContext:
891889
runAsNonRoot: true
@@ -1006,7 +1004,7 @@ spec:
10061004
name: pipeline-name
10071005
taskRunSpecs:
10081006
- pipelineTaskName: task-name
1009-
metadata:
1007+
metadata:
10101008
annotations:
10111009
vault.hashicorp.com/agent-inject-secret-foo: "/path/to/foo"
10121010
vault.hashicorp.com/role: role-name
@@ -1020,7 +1018,7 @@ spec:
10201018
name: pipeline-name
10211019
taskRunSpecs:
10221020
- pipelineTaskName: task-name
1023-
metadata:
1021+
metadata:
10241022
labels:
10251023
app: cloudevent
10261024
```
@@ -1110,23 +1108,23 @@ spec:
11101108
tasks:
11111109
- name: fetch-secure-data
11121110
# workspaces:
1113-
# - name: shared-data
1111+
# - name: shared-data
11141112
taskSpec:
11151113
# workspaces:
1116-
# - name: shared-data
1114+
# - name: shared-data
11171115
steps:
11181116
- name: fetch-and-write-secure
11191117
image: ubuntu
11201118
script: |
11211119
echo hi >> $(workspaces.shared-data.path)/recipe.txt
11221120
- name: print-the-recipe
11231121
# workspaces:
1124-
# - name: shared-data
1122+
# - name: shared-data
11251123
runAfter:
11261124
- fetch-secure-data
11271125
taskSpec:
11281126
# workspaces:
1129-
# - name: shared-data
1127+
# - name: shared-data
11301128
steps:
11311129
- name: print-secrets
11321130
image: ubuntu
@@ -1259,7 +1257,7 @@ spec:
12591257
- name: fetch-and-write
12601258
image: ubuntu
12611259
script: |
1262-
echo $(workspaces.shared-data.path)
1260+
echo $(workspaces.shared-data.path)
12631261
---
12641262
apiVersion: tekton.dev/v1 # or tekton.dev/v1beta1
12651263
kind: PipelineRun
@@ -1432,7 +1430,7 @@ If you set the timeout to 0, the `PipelineRun` fails immediately upon encounteri
14321430
Your `PipelineRun`'s `status` field can contain the following fields:
14331431

14341432
- Required:
1435-
- `status` - Most relevant, `status.conditions`, which contains the latest observations of the `PipelineRun`'s state. [See here](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties) for information on typical status properties.
1433+
- `status` - Most relevant, `status.conditions`, which contains the latest observations of the `PipelineRun`'s state. [See here](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties) for information on typical status properties.
14361434
- `startTime` - The time at which the `PipelineRun` began executing, in [RFC3339](https://tools.ietf.org/html/rfc3339) format.
14371435
- `completionTime` - The time at which the `PipelineRun` finished executing, in [RFC3339](https://tools.ietf.org/html/rfc3339) format.
14381436
- [`pipelineSpec`](pipelines.md#configuring-a-pipeline) - The exact `PipelineSpec` used when starting the `PipelineRun`.

docs/pipelines.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ spec:
301301
If the `Param` value passed in by `PipelineRun` is **NOT** in the predefined `enum` list, the `PipelineRun` will fail with reason `InvalidParamValue`.
302302

303303
If a `PipelineTask` references a `Task` with `enum`, the `enums` specified in the Pipeline `spec.params` (pipeline-level `enum`) must be
304-
a **subset** of the `enums` specified in the referenced `Task` (task-level `enum`). An empty pipeline-level `enum` is invalid
305-
in this scenario since an empty `enum` set indicates a "universal set" which allows all possible values. The same rules apply to `Pipelines` with embbeded `Tasks`.
304+
a **subset** of the `enums` specified in the referenced `Task` (task-level `enum`). An empty pipeline-level `enum` is invalid
305+
in this scenario since an empty `enum` set indicates a "universal set" which allows all possible values. The same rules apply to `Pipelines` with embbeded `Tasks`.
306306

307307
In the below example, the referenced `Task` accepts `v1` and `v2` as valid values, the `Pipeline` further restricts the valid value to `v1`.
308308

@@ -1280,7 +1280,7 @@ Sharing `Results` between `Tasks` in a `Pipeline` happens via
12801280
a `Result` and another receives it as a `Parameter` with a variable such as
12811281
`$(tasks.<task-name>.results.<result-name>)`. Pipeline support two new types of
12821282
results and parameters: array `[]string` and object `map[string]string`.
1283-
Array and Object result is a beta feature and can be enabled by setting `enable-api-fields` to `alpha` or `beta`.
1283+
Array result is a beta feature and can be enabled by setting `enable-api-fields` to `alpha` or `beta`.
12841284

12851285
| Result Type | Parameter Type | Specification | `enable-api-fields` |
12861286
|-------------|----------------|--------------------------------------------------|---------------------|
@@ -1375,7 +1375,7 @@ results:
13751375

13761376
For an end-to-end example, see [`Results` in a `PipelineRun`](../examples/v1/pipelineruns/pipelinerun-results.yaml).
13771377

1378-
Object result and array result are beta features,
1378+
Array result is a beta feature,
13791379
see [`Array and Object Results` in a `PipelineRun`](../examples/v1/pipelineruns/beta/pipeline-emitting-results.yaml).
13801380

13811381
```yaml

docs/taskruns.md

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,10 @@ status:
304304
reason: Succeeded
305305
status: "True"
306306
type: Succeeded
307-
...
307+
...
308308
steps:
309309
- container: step-default
310-
...
310+
...
311311
taskSpec:
312312
steps:
313313
- image: ubuntu
@@ -317,8 +317,6 @@ status:
317317
```
318318

319319
#### Propagated Object Parameters
320-
Object params is a [beta feature](./additional-configs.md#beta-features).
321-
322320
When using an inlined `taskSpec`, object parameters from the parent `TaskRun` will be
323321
available to the `Task` without needing to be explicitly defined.
324322

@@ -438,13 +436,13 @@ spec:
438436
apiVersion: tekton.dev/v1 # or tekton.dev/v1beta1
439437
kind: TaskRun
440438
metadata:
441-
name: taskrun
439+
name: taskrun
442440
spec:
443441
taskRef:
444442
name: task
445443
computeResources:
446444
requests:
447-
cpu: 1
445+
cpu: 1
448446
limits:
449447
cpu: 2
450448
```
@@ -524,21 +522,21 @@ workspaces down to other inlined resources.
524522
**Workspace substutions will only be made for `commands`, `args` and `script` fields of `steps`, `stepTemplates`, and `sidecars`.**
525523

526524
```yaml
527-
apiVersion: tekton.dev/v1 # or tekton.dev/v1beta1
528-
kind: TaskRun
525+
apiVersion: tekton.dev/v1 # or tekton.dev/v1beta1
526+
kind: TaskRun
529527
metadata:
530528
generateName: propagating-workspaces-
531529
spec:
532-
taskSpec:
533-
steps:
534-
- name: simple-step
535-
image: ubuntu
536-
command:
537-
- echo
538-
args:
530+
taskSpec:
531+
steps:
532+
- name: simple-step
533+
image: ubuntu
534+
command:
535+
- echo
536+
args:
539537
- $(workspaces.tr-workspace.path)
540-
workspaces:
541-
- emptyDir: {}
538+
workspaces:
539+
- emptyDir: {}
542540
name: tr-workspace
543541
```
544542

@@ -564,32 +562,32 @@ status:
564562

565563
##### Propagating Workspaces to Referenced Tasks
566564

567-
Workspaces can only be propagated to `embedded` task specs, not `referenced` Tasks.
565+
Workspaces can only be propagated to `embedded` task specs, not `referenced` Tasks.
568566

569567
```yaml
570-
apiVersion: tekton.dev/v1 # or tekton.dev/v1beta1
571-
kind: Task
568+
apiVersion: tekton.dev/v1 # or tekton.dev/v1beta1
569+
kind: Task
572570
metadata:
573571
name: workspace-propagation
574572
spec:
575573
steps:
576-
- name: simple-step
577-
image: ubuntu
578-
command:
579-
- echo
580-
args:
574+
- name: simple-step
575+
image: ubuntu
576+
command:
577+
- echo
578+
args:
581579
- $(workspaces.tr-workspace.path)
582580
---
583-
apiVersion: tekton.dev/v1 # or tekton.dev/v1beta1
581+
apiVersion: tekton.dev/v1 # or tekton.dev/v1beta1
584582
kind: TaskRun
585583
metadata:
586584
generateName: propagating-workspaces-
587585
spec:
588-
taskRef:
586+
taskRef:
589587
name: workspace-propagation
590-
workspaces:
591-
- emptyDir: {}
592-
name: tr-workspace
588+
workspaces:
589+
- emptyDir: {}
590+
name: tr-workspace
593591
```
594592

595593
Upon execution, the above `TaskRun` will fail because the `Task` is referenced and workspace is not propagated. It must be explicitly defined in the `spec` of the defined `Task`.
@@ -788,7 +786,7 @@ The `status` field defines the observed state of `TaskRun`
788786
### The `status` field
789787
- Required:
790788
- `status` - The most relevant information about the TaskRun's state. This field includes:
791-
- `status.conditions`, which contains the latest observations of the `TaskRun`'s state. [See here](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties) for information on typical status properties.
789+
- `status.conditions`, which contains the latest observations of the `TaskRun`'s state. [See here](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties) for information on typical status properties.
792790
- `podName` - Name of the pod containing the containers responsible for executing this `task`'s `step`s.
793791
- `startTime` - The time at which the `TaskRun` began executing, conforms to [RFC3339](https://tools.ietf.org/html/rfc3339) format.
794792
- `completionTime` - The time at which the `TaskRun` finished executing, conforms to [RFC3339](https://tools.ietf.org/html/rfc3339) format.
@@ -802,11 +800,11 @@ The `status` field defines the observed state of `TaskRun`
802800
- `featureFlags`: Identifies the feature flags used during the `TaskRun`.
803801
- `steps` - Contains the `state` of each `step` container.
804802
- `retriesStatus` - Contains the history of `TaskRun`'s `status` in case of a retry in order to keep record of failures. No `status` stored within `retriesStatus` will have any `date` within as it is redundant.
805-
803+
806804
- [`sidecars`](tasks.md#using-a-sidecar-in-a-task) - This field is a list. The list has one entry per `sidecar` in the manifest. Each entry represents the imageid of the corresponding sidecar.
807805
- `spanContext` - Contains tracing span context fields.
808-
809-
806+
807+
810808

811809
## Monitoring execution status
812810

@@ -860,7 +858,7 @@ False | TaskRunImagePullFailed | n/a
860858

861859
When a `TaskRun` changes status, [events](events.md#taskruns) are triggered accordingly.
862860

863-
The name of the `Pod` owned by a `TaskRun` is univocally associated to the owning resource.
861+
The name of the `Pod` owned by a `TaskRun` is univocally associated to the owning resource.
864862
If a `TaskRun` resource is deleted and created with the same name, the child `Pod` will be created with the same name
865863
as before. The base format of the name is `<taskrun-name>-pod`. The name may vary according to the logic of
866864
[`kmeta.ChildName`](https://pkg.go.dev/github.com/knative/pkg/kmeta#ChildName). In case of retries of a `TaskRun`

0 commit comments

Comments
 (0)