Skip to content

Commit

Permalink
clarify in docs to not use apiVersion for taskRef for non-customtask
Browse files Browse the repository at this point in the history
This commit closes #6682. When apiversion and kind are both set for
task, it is also considered to be a custom task. If users want to refer
to tasks or cluster tasks, apiVersion shouldn't be set. This commit
clarify this in the docs.

Signed-off-by: Yongxuan Zhang [email protected]
  • Loading branch information
Yongxuanzhang committed May 24, 2023
1 parent 96212a1 commit d673584
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion docs/pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ tasks:
name: build-push
```

**Note:** Using both `apiVersion` and `kind` will create [CustomRun](customruns.md), don't set `apiVersion` if only referring to [`Task`](tasks.md).

or

```yaml
Expand Down Expand Up @@ -1537,7 +1539,7 @@ that is responsible for watching and updating `CustomRun`s which reference their
### Specifying the target Custom Task

To specify the custom task type you want to execute, the `taskRef` field
must include the custom task's `apiVersion` and `kind` as shown below:
must include the custom task's `apiVersion` and `kind` as shown below, `apiVersion` is only used to create `CustomRun`:

```yaml
spec:
Expand Down
7 changes: 3 additions & 4 deletions pkg/reconciler/taskrun/resources/taskref_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,10 +396,9 @@ func TestGetTaskFunc(t *testing.T) {
},
},
ref: &v1beta1.TaskRef{
Name: "simple",
APIVersion: "tekton.dev/v1beta1",
Kind: v1beta1.ClusterTaskKind,
Bundle: u.Host + "/remote-cluster-task",
Name: "simple",
Kind: v1beta1.ClusterTaskKind,
Bundle: u.Host + "/remote-cluster-task",
},
expected: &v1beta1.Task{
ObjectMeta: metav1.ObjectMeta{Name: "simple"},
Expand Down

0 comments on commit d673584

Please sign in to comment.