-
Notifications
You must be signed in to change notification settings - Fork 259
pipeline start supports taskRunSpec argument #1969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 4 commits
feb0a01
bbe9740
1e5023f
aabe9e6
095983a
4dba6ad
ede2079
0663311
5f4ffd5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apiVersion: tekton.dev/v1 | ||
kind: PipelineRun | ||
metadata: | ||
creationTimestamp: null | ||
generateName: test-pipeline-run- | ||
labels: | ||
jemange: desfrites | ||
namespace: ns | ||
spec: | ||
params: | ||
- name: pipeline-param | ||
value: value1 | ||
- name: rev-param | ||
value: value2 | ||
pipelineRef: | ||
name: test-pipeline | ||
taskRunSpecs: | ||
- pipelineTaskName: unit-test-task | ||
podTemplate: | ||
schedulerName: SchedulerName | ||
securityContext: | ||
runAsNonRoot: true | ||
runAsUser: 1001 | ||
taskRunTemplate: | ||
serviceAccountName: svc1 | ||
status: {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Flag --resource has been deprecated, pipelineresources have been deprecated, this flag will be removed soon | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: PipelineRun | ||
metadata: | ||
creationTimestamp: null | ||
generateName: test-pipeline-run- | ||
labels: | ||
jemange: desfrites | ||
namespace: ns | ||
spec: | ||
params: | ||
- name: pipeline-param | ||
value: value1 | ||
- name: rev-param | ||
value: value2 | ||
pipelineRef: | ||
name: test-pipeline | ||
resources: | ||
- name: source | ||
resourceRef: | ||
name: scaffold-git | ||
serviceAccountName: svc1 | ||
taskRunSpecs: | ||
- pipelineTaskName: unit-test-task | ||
taskPodTemplate: | ||
schedulerName: SchedulerName | ||
securityContext: | ||
runAsNonRoot: true | ||
runAsUser: 1001 | ||
status: {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- pipelineTaskName: unit-test-task | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I referred #1088 writing this pr, and it's mostly the same but here hardcoded pipelineTaskName maybe seems fragile to future change. maybe ok? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @haedaal what could be the other options ? multiple flags There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. may be we can add a check in parsing to have multiple tasks There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vdemeester I feel like there's no better alternatives, as it looks exactly same as k8s spec. I think simplicity is worth a bit of fragility. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. need license header here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed @ 0663311 |
||
taskPodTemplate: | ||
schedulerName: SchedulerName | ||
securityContext: | ||
runAsNonRoot: true | ||
runAsUser: 1001 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -305,6 +305,23 @@ Waiting for logs to be available... | |
} | ||
}) | ||
|
||
t.Run("Start PipelineRun with --task-run-spec", func(t *testing.T) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When I try to run e2e test, I'm seeing following log
So I've written this code, but never have run it. What should I do? |
||
tkn.MustSucceed(t, "pipeline", "start", tePipelineName, | ||
"-p=filename=output", | ||
"-w=name=shared-data,emptyDir=", | ||
"--task-run-spec="+helper.GetResourcePath("/taskrunspec/taskrunspec.yaml"), | ||
"--use-param-defaults", | ||
"--showlog") | ||
|
||
time.Sleep(1 * time.Second) | ||
|
||
pipelineRunGeneratedName := builder.GetPipelineRunListWithName(c, tePipelineName, true).Items[0].Name | ||
timeout := 5 * time.Minute | ||
if err := wait.ForPipelineRunState(c, pipelineRunGeneratedName, timeout, wait.PipelineRunSucceed(pipelineRunGeneratedName), "PipelineRunSucceeded"); err != nil { | ||
t.Errorf("Error waiting for PipelineRun to Succeed: %s", err) | ||
} | ||
}) | ||
|
||
t.Run("Cancel finished PipelineRun with tkn pipelinerun cancel", func(t *testing.T) { | ||
// Get last PipelineRun for pipeline-with-workspace | ||
pipelineRunLast := builder.GetPipelineRunListWithName(c, tePipelineName, true).Items[0] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- pipelineTaskName: first-create-file | ||
taskPodTemplate: | ||
schedulerName: SchedulerName | ||
securityContext: | ||
runAsNonRoot: true | ||
runAsUser: 1001 |
Uh oh!
There was an error while loading. Please reload this page.