-
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.
Add functionality to set task run spec
Currently it is not possible to set task run specs on each individual tasks. This PR aims to fix that and give the user more flexibility to set podTemplate for each task. Co-Authored-By: Daniel Helfand <[email protected]>
- Loading branch information
1 parent
8bac7f3
commit 2fcbfae
Showing
9 changed files
with
431 additions
and
3 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
86 changes: 86 additions & 0 deletions
86
examples/v1beta1/pipelineruns/pipelinerun-taskrunspecs.yaml
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,86 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: add-task-taskspec | ||
spec: | ||
params: | ||
- name: first | ||
description: the first operand | ||
- name: second | ||
description: the second operand | ||
results: | ||
- name: sum | ||
description: the sum of the first and second operand | ||
steps: | ||
- name: add | ||
image: alpine | ||
env: | ||
- name: OP1 | ||
value: $(params.first) | ||
- name: OP2 | ||
value: $(params.second) | ||
command: ["/bin/sh", "-c"] | ||
args: | ||
- echo -n $((${OP1}+${OP2})) | tee $(results.sum.path); | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Pipeline | ||
metadata: | ||
name: add-pipeline-taskspec | ||
spec: | ||
params: | ||
- name: first | ||
description: the first operand | ||
- name: second | ||
description: the second operand | ||
- name: third | ||
description: the third operand | ||
tasks: | ||
- name: first-add-taskspec | ||
taskRef: | ||
name: add-task-taskspec | ||
params: | ||
- name: first | ||
value: $(params.first) | ||
- name: second | ||
value: $(params.second) | ||
- name: second-add-taskspec | ||
taskRef: | ||
name: add-task-taskspec | ||
params: | ||
- name: first | ||
value: $(tasks.first-add-taskspec.results.sum) | ||
- name: second | ||
value: $(params.third) | ||
results: | ||
- name: sum | ||
description: the sum of all three operands | ||
value: $(tasks.second-add-taskspec.results.sum) | ||
- name: partial-sum | ||
description: the sum of first two operands | ||
value: $(tasks.first-add-taskspec.results.sum) | ||
- name: all-sum | ||
description: the sum of everything | ||
value: $(tasks.second-add-taskspec.results.sum)-$(tasks.first-add-taskspec.results.sum) | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: PipelineRun | ||
metadata: | ||
name: task-spec-pipeline | ||
spec: | ||
pipelineRef: | ||
name: add-pipeline-taskspec | ||
taskRunSpecs: | ||
- pipelineTaskName: first-add-taskspec | ||
taskServiceAccountName: 'default' | ||
- pipelineTaskName: second-add-taskspec | ||
taskPodTemplate: | ||
nodeSelector: | ||
disktype: ssd | ||
params: | ||
- name: first | ||
value: "2" | ||
- name: second | ||
value: "10" | ||
- name: third | ||
value: "10" |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.
Isn't this a duplicate way to specify
ServiceAccountName
for a Task in aPipelineRun
?What is the difference between these two (in PipelineRun):