feat: allow Pipeline authors to override Task compute resources#9633
Draft
waveywaves wants to merge 1 commit intotektoncd:mainfrom
Draft
feat: allow Pipeline authors to override Task compute resources#9633waveywaves wants to merge 1 commit intotektoncd:mainfrom
waveywaves wants to merge 1 commit intotektoncd:mainfrom
Conversation
Collaborator
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Add StepSpecs, SidecarSpecs, and ComputeResources fields to PipelineTask, allowing Pipeline authors to override the referenced Task's resource requirements without duplicating the Task or requiring users to specify taskRunSpecs in every PipelineRun. Precedence chain: Task defaults < Pipeline PipelineTask overrides < PipelineRun taskRunSpecs overrides. Changes: - v1 PipelineTask: add StepSpecs, SidecarSpecs, ComputeResources - v1beta1 PipelineTask: add matching fields + wire conversion - Validation: reuse validateStepSpecs/validateSidecarSpecs/ validateTaskRunComputeResources from taskrun_validation.go - Variable substitution: apply param replacements to StepSpecs and SidecarSpecs names in replaceVariablesInPipelineTasks - Reconciler: Pipeline-level values set first, PipelineRun-level taskRunSpecs override them if specified - Regenerated deepcopy, CRD, OpenAPI, and API docs Closes tektoncd#9630 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
53f6316 to
d6eca52
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Adds
stepSpecs,sidecarSpecs, andcomputeResourcesfields toPipelineTask,allowing Pipeline authors to override the referenced Task's resource requirements
without duplicating the Task or requiring users to specify
taskRunSpecsin everyPipelineRun.
The problem
Today, resource overrides are only possible at:
Task.spec.steps[].computeResources(set by the task author)PipelineRun.spec.taskRunSpecs[].computeResources(set by the user at runtime)There is no way for a Pipeline author to override resources at definition time. This forces
pipeline authors to either duplicate tasks with different resource values or require users to
specify
taskRunSpecsin every PipelineRun — both of which are poor UX as demonstrated byrecent Konflux issues where users had to override resources for dozens of individual
.tektonfiles.
The solution
Precedence chain: Task defaults < Pipeline PipelineTask overrides < PipelineRun taskRunSpecs overrides
This mirrors how
timeoutalready works onPipelineTask— Pipeline sets a default, PipelineRuncan override it.
Implementation
StepSpecs,SidecarSpecs,ComputeResourcesfields toPipelineTaskinpkg/apis/pipeline/v1/pipeline_types.gocreateTaskRun(), Pipeline-level values are set first, then PipelineRun-leveltaskRunSpecsoverride them if specified (pkg/reconciler/pipelinerun/pipelinerun.go)TODO (follow-up commits)
hack/update-codegen.sh)pipeline_validation.goRelated Issues
Submitter Checklist
Release Note