-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
TEP-0111 - Propagating workspaces in taskruns #5081
TEP-0111 - Propagating workspaces in taskruns #5081
Conversation
The following is the coverage report on the affected files.
|
b77584a
to
2000cb1
Compare
The following is the coverage report on the affected files.
|
2000cb1
to
5fe2d48
Compare
The following is the coverage report on the affected files.
|
/retest |
/kind feature |
/retest |
1 similar comment
/retest |
/test check-pr-has-kind-label |
@chitrangpatel: The specified target(s) for
The following commands are available to trigger optional jobs:
Use
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/kind feature |
The following is the coverage report on the affected files.
|
/retest |
/assign @dibyom |
The following is the coverage report on the affected files.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you Chitrang for splitting into multiple PRs! it's a big help
93a8d35
to
56228ef
Compare
The following is the coverage report on the affected files.
|
56228ef
to
13ef6d8
Compare
The following is the coverage report on the affected files.
|
13ef6d8
to
2de5f8b
Compare
The following is the coverage report on the affected files.
|
pkg/workspace/apply_test.go
Outdated
Sidecars: []v1beta1.Sidecar{{ | ||
Name: "conflicting volume mount sidecar", | ||
VolumeMounts: []corev1.VolumeMount{{ | ||
Name: "mount-path-conflicts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like this test case is for conflicting mount paths, can you rename to reflect what's being tested here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it wasn't. Its my mistake. Copy and pasting the above test and then modifying it lead to this confusion. I apologize. I will update it to better reflect the test its actually doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this into its own test to check the functionality I added in apply.go
} | ||
|
||
// FindWorkspaceSubstitutionLocationsInTask returns a set of all the locations in the TaskSpec where we can apply substitutions. | ||
func (ts *TaskSpec) FindWorkspaceSubstitutionLocationsInTask() sets.String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this function being used? It looks like this is functionality for replacing workspaces.foo.path
syntax but I don't see it being used anywhere-- is this replacement happening as part of this PR?
If this function does need to be in this PR, I don't think it should be exported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Even though it is written in task_types, it might be being called from the PR handling propagated workspaces in pipelinerun.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, how is this PR performing substitutions for task scripts/args containing $(workspaces.foo.path)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function was being called in the pipelinerun reconciler to parse the pipelineTask
and identify which workspaces are being called. The reconciler then propagated those workspaces to the pipelineTasks by creating task bindings.
The taskRun reconciler (reconciler/taskrun/taskrun.go
) does a similar thing and propagates workspaces to the taskSpec.
The substitutions happen the way they did before. i.e. via https://github.com/chitrangpatel/pipeline/blob/e302587a9dcbc7af8cc1475dfa24c3c35a6715f9/pkg/reconciler/pipelinerun/resources/apply.go#L173-L185.
2de5f8b
to
e302587
Compare
The following is the coverage report on the affected files.
|
e302587
to
bad5e4b
Compare
bad5e4b
to
a51171d
Compare
The following is the coverage report on the affected files.
|
This POC illustrates propagating workspaces defined at the `pipelinerun` stage and directly referred at the `spec`. There is no need to specify it in the `pipelinespec` followed by `tasks` and `taskspec`.
a51171d
to
62f0f52
Compare
The following is the coverage report on the affected files.
|
/retest |
1 similar comment
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
@@ -2545,8 +2590,14 @@ spec: | |||
Kind: "Task", | |||
TaskSpec: &v1beta1.TaskSpec{Steps: simpleTask.Spec.Steps, Workspaces: simpleTask.Spec.Workspaces}, | |||
} | |||
taskSpec := updateTaskSpecParamsContextsResults(context.Background(), taskRun, rtr) | |||
pod, err := r.createPod(testAssets.Ctx, taskSpec, taskRun, rtr) | |||
ctx := config.EnableAlphaAPIFields(context.Background()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would you mind creating an issue to refactor these tests to call Reconcile
rather than all of these helpers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I can do that.
The verbosity of writing specifications in Tekton Pipelines is a common pain point that creates difficulties in getting-started scenarios. In addition, the verbosity leads to long specifications that are error-prone, harder to maintain, and reach the etcd size limits for CRDs. Automatically propagating Workspaces will lead to better user experience. This addresses features proposed in TEP-0111. This PR addresses propagating workspaces in
TaskRuns
. A follow up PR is addressing propagating workspaces inPipelineRuns
.Changes
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
(if there are no user facing changes, use release note "NONE")
Release Notes