-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Pipeline error with ClusterTasks
It is possible to use `ClusterTask` in a Pipeline, for that you specify that the `Task` you want to use is of type `ClusterTask` (default being `Task`). But, before this change, the `PipelineRun` using this `Pipeline` would fail as the `Kind` information is not passed from the `PipelineTask.TaskRef` to the actual `TaskRun`. This fixes that by passing the `Kind` of a `TaskRef` when resolving the `Task`/`TaskRun` in the `PipelineRun` reconcilier. A yaml test is added as a regression test. Signed-off-by: Vincent Demeester <[email protected]>
- Loading branch information
1 parent
2a5a263
commit cf2ecd5
Showing
6 changed files
with
50 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: ClusterTask | ||
metadata: | ||
name: cluster-task-pipeline-4 | ||
spec: | ||
steps: | ||
- name: task-two-step-one | ||
image: ubuntu | ||
command: ["/bin/bash"] | ||
args: ['-c', 'echo success'] | ||
--- | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: Pipeline | ||
metadata: | ||
name: sample-pipeline-cluster-task-4 | ||
spec: | ||
tasks: | ||
- name: cluster-task-pipeline-4 | ||
taskRef: | ||
name: cluster-task-pipeline-4 | ||
kind: ClusterTask | ||
--- | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: PipelineRun | ||
metadata: | ||
name: demo-pipeline-run-4 | ||
spec: | ||
pipelineRef: | ||
name: sample-pipeline-cluster-task-4 | ||
trigger: | ||
type: manual | ||
serviceAccount: 'default' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters