-
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
Implement Step and Sidecar Overrides for TaskRun #4598
Conversation
/assign wlynch Feel free to unassign yourself if you don't have time to review! Just assigning you since you reviewed the TEP pretty thoroughly. |
The following is the coverage report on the affected files.
|
98411f0
to
ef13bea
Compare
The following is the coverage report on the affected files.
|
ef13bea
to
3bba8e8
Compare
The following is the coverage report on the affected files.
|
/hold |
3bba8e8
to
140f26d
Compare
/hold cancel |
The following is the coverage report on the affected files.
|
/lgtm |
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.
thanks @lbernick - looks good, left a few comments
140f26d
to
159f675
Compare
The following is the coverage report on the affected files.
|
159f675
to
9da9add
Compare
The following is the coverage report on the affected files.
|
/test pull-tekton-pipeline-integration-tests |
/test pull-tekton-pipeline-alpha-integration-tests |
/lgtm Cheers @lbernick ! |
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.
mostly lgtm! just a few nits regarding exporting funcs.
}} | ||
for _, tc := range tcs { | ||
t.Run(tc.name, func(t *testing.T) { | ||
err := taskrun.ValidateOverrides(context.Background(), tc.ts, tc.trs) |
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.
Instead of exporting this func, can we move the test into the same package?
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.
done. I left ValidateResolvedTaskResources
exported as it's used in the pipelinerun reconciler to validate the param/resource bindings passed from the pipeline -> pipelinerun -> taskrun.
steps, err = v1beta1.MergeStepsWithOverrides(steps, taskRun.Spec.StepOverrides) | ||
if err != nil { | ||
return nil, err | ||
} | ||
sidecars, err := v1beta1.MergeSidecarsWithOverrides(taskSpec.Sidecars, taskRun.Spec.SidecarOverrides) | ||
if err != nil { | ||
return nil, err | ||
} |
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.
There's a TODO above to move the MergeStepsWithStepTemplate to this package (presumably to unexport it) - should we just do this from the get-go with these funcs? 🤔
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.
Discussed offline and reopened #1605 with comments.
This implements TEP-0094: Configuring Resources at Runtime. StepOverrides and SidecarOverrides were added to the API in a previous commit. This commit allows them to override resource requirements specified in the Task spec. The same merging strategy that is currently used for stepTemplate is also used for step and sidecar overrides, except that only the resources field of the container is overridden, and unlike with templates, the overrides take precedence over the Task spec.
9da9add
to
c6ffaf3
Compare
The following is the coverage report on the affected files.
|
The /test pull-tekton-pipeline-alpha-integration-tests /lgtm |
@wlynch would you mind taking another look at this? |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester, wlynch The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Integration run failed on a yaml example. Let's see if it repeats. Workspace-in-sidecar failed in the alpha integration run, no logs because the step's container was waiting to start. /test pull-tekton-pipeline-integration-tests /test pull-tekton-pipeline-alpha-integration-tests |
Changes
This implements TEP-0094: Configuring Resources at Runtime.
StepOverrides and SidecarOverrides were added to the API in a previous commit.
This commit allows them to override resource requirements specified in the Task spec.
The same merging strategy that is currently used for stepTemplate is also used for
step and sidecar overrides, except that only the resources field of the container is overridden,
and unlike with templates, the overrides take precedence over the Task spec.
Closes #4326.
Tested E2E locally. Happy to split into separate PRs if this would be helpful.
/kind feature
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
Release Notes