Skip to content

Commit 524ca13

Browse files
XinruZhangtekton-robot
authored andcommitted
Support both v1alpha1 and v1beta1 for Custom Task
Support both v1alpha1.Run and v1beta1.CustomRun for 4 LTS releases after Beta release so that custom task end users and developers are able to fully test and migrate Custom Task from alpha to beta To achieve this, this commit introduces a new feature flag to control the version switch between alpha and beta when defining a custom task within a Pipeline.
1 parent 5d29d75 commit 524ca13

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

teps/0114-custom-tasks-beta.md

+20-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
status: implementable
33
title: Custom Tasks Beta
44
creation-date: '2022-07-12'
5-
last-updated: '2022-11-14'
5+
last-updated: '2022-11-24'
66
authors:
77
- '@jerop'
88
- '@XinruZhang'
@@ -29,6 +29,7 @@ see-also:
2929
- [References and Specifications](#references-and-specifications)
3030
- [Remove Pod Template](#remove-pod-template)
3131
- [Feature Gates](#feature-gates)
32+
- [Cancellation](#cancellation)
3233
- [Documentation](#documentation)
3334
- [Testing](#testing)
3435
- [Optional](#optional)
@@ -205,12 +206,28 @@ own specification.
205206

206207
##### Feature Gates
207208

209+
##### New Feature Flag `custom-task-version`
210+
211+
Support both `v1alpha1.Run` and `v1beta1.CustomRun` for **four** [long term support (LTS)][long-term-support]
212+
releases. So that custom task implementors and end users are able to fully test and migrate Custom Task from
213+
`v1alpha1` to `v1beta1`.
214+
215+
Create a new feature flag `custom-task-version` to allow end users to choose which version of custom task to be
216+
created out of a `PipelineTask`. We set the default feature flag value to `v1alpha1` in the first LTS release, and
217+
switch to `v1beta1` in the following three LTS releases.
218+
219+
Say we start to support `v1beta1.CustomRun` in LTS release `X`, and set default value of `custom-task-version`
220+
to `v1alpha1`. In the LTS release `X+1`, we switch the default value to `v1beta1`. In the LTS release `X+4`, we
221+
remove the feature flag, and only support `v1beta1`.
222+
223+
##### Existing Feature Gates
224+
208225
Remove guarding of `Custom Tasks` behind `enable-custom-tasks` and `enable-api-fields` feature gates.
209226

210227
When [TEP-0096: Pipelines V1 API][tep-0096] is implemented to add V1 API, `Custom Tasks` will be gated behind feature
211228
gate `enable-api-fields` being set to `"beta"` - this is out of scope for this TEP (in scope for TEP-0096).
212229

213-
##### Cancellation
230+
#### Cancellation
214231

215232
The custom task is responsible for implementing `cancellation` to support pipelineRun level `timeouts` and `cancellation`. If the Custom Task implementor does not support cancellation via `.spec.status`, `Pipeline` **can not** timeout within the specified interval/duration and **can not** be cancelled as expected upon request.
216233

@@ -366,3 +383,4 @@ For further details, see [tektoncd/community#523][523], [tektoncd/community#667]
366383
[5138]: https://github.com/tektoncd/pipeline/issues/5138
367384
[cancel-pr]: https://github.com/tektoncd/pipeline/blob/main/docs/pipelineruns.md#cancelling-a-pipelinerun
368385
[gracefully-cancel-pr]: (https://github.com/tektoncd/pipeline/blob/main/docs/pipelineruns.md#gracefully-cancelling-a-pipelinerun)
386+
[long-term-support]: https://github.com/tektoncd/community/blob/main/releases.md#support-policy

teps/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ This is the complete list of Tekton teps:
281281
|[TEP-0110](0110-decouple-catalog-organization-and-reference.md) | Decouple Catalog Organization and Resource Reference | implemented | 2022-06-29 |
282282
|[TEP-0111](0111-propagating-workspaces.md) | Propagating Workspaces | implemented | 2022-09-16 |
283283
|[TEP-0112](0112-replace-volumes-with-workspaces.md) | Replace Volumes with Workspaces | proposed | 2022-07-20 |
284-
|[TEP-0114](0114-custom-tasks-beta.md) | Custom Tasks Beta | implementable | 2022-11-14 |
284+
|[TEP-0114](0114-custom-tasks-beta.md) | Custom Tasks Beta | implementable | 2022-11-24 |
285285
|[TEP-0115](0115-tekton-catalog-git-based-versioning.md) | Tekton Catalog Git-Based Versioning | implementable | 2022-11-09 |
286286
|[TEP-0116](0116-referencing-finally-task-results-in-pipeline-results.md) | Referencing Finally Task Results in Pipeline Results | implemented | 2022-08-11 |
287287
|[TEP-0117](0117-tekton-results-logs.md) | Tekton Results Logs | implementable | 2022-10-21 |

0 commit comments

Comments
 (0)