Skip to content
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

merge podTemplates instead of overriding #6850

Conversation

pritidesai
Copy link
Member

@pritidesai pritidesai commented Jun 20, 2023

Changes

The podTemplate can be specified for any given pipelineTask at the pipelineRun.spec.taskRunSpecs.

The podTemplate can also be specified for the entire pipeline at the pipelineRun.spec.podTemplate.

Before this commit, the podTemplates at the pipelineRun level were ignored if it was specified at the taskRunSpecs. This resulted in the settings specified at the pipelineRun level not included along with the pipelineTask specific configuration. For example, there could be a common setting at the pipelineRun level to set the User and Group for all the pipelineTasks and a pipelineTask can have its own diskType. Without this commit, the taskRun runs with a podTemplate with the specified diskType but no user or group configurations.

Fixes #6846

/kind bug

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

Merge podTemplate specified in pipelineRun.spec.taskRunSpecs[].podTemplate along with pipelineRun.spec.podTemplate instead of only considering the one specified at the taskRunSpecs. 

The podTemplate can be specified for any given pipelineTask at the
pipelineRun.spec.taskRunSpecs.

The podTemplate can also be specified for the entire pipeline at the
pipelineRun.spec.podTemplate.

Before this commit, the podTemplates at the pipelineRun level were
ignored if it was specified at the taskRunSpecs. This results in the settings
specified at the pipelineRun level not included along with the pipelineTask
specific configuration. For example, there could be a common setting at the
pipelineRun level to set the User and Group for all the pipelineTasks and
a pipelineTask can have its own diskType. Without this commit, the taskRun
runs with a podTemplate with the specified diskType and no user or group
configurations.

Signed-off-by: Priti Desai <[email protected]>
@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 20, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/pipelinerun_types.go 89.6% 89.5% -0.1
pkg/apis/pipeline/v1beta1/pipelinerun_types.go 89.8% 89.7% -0.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/pipelinerun_types.go 89.6% 89.5% -0.1
pkg/apis/pipeline/v1beta1/pipelinerun_types.go 89.8% 89.7% -0.1

@dibyom
Copy link
Member

dibyom commented Jun 21, 2023

LGTM!
cc @lbernick

@dibyom dibyom closed this Jun 21, 2023
@dibyom dibyom reopened this Jun 21, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/pipelinerun_types.go 89.6% 89.5% -0.1
pkg/apis/pipeline/v1beta1/pipelinerun_types.go 89.8% 89.7% -0.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/pipelinerun_types.go 89.6% 89.5% -0.1
pkg/apis/pipeline/v1beta1/pipelinerun_types.go 89.8% 89.7% -0.1

@pritidesai
Copy link
Member Author

Thanks @dibyom 👍

@tektoncd/core-maintainers please help review this 🙏 I will cherry pick this into previous LTS releases once this is merged, Thanks!

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 22, 2023
Copy link
Member

@jerop jerop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 22, 2023
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jerop, lbernick

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot merged commit 846e6b1 into tektoncd:main Jun 22, 2023
@pritidesai pritidesai deleted the taskrunspecs-pipelinerun-spec-podtemplate branch June 22, 2023 16:56
@pritidesai
Copy link
Member Author

pritidesai commented Jun 22, 2023

Since we have identified and classified this as a bug, backporting this to all active LTS releases (v0.41, v0.44, v0.47).

/cherry-pick release-v0.47.x

@tekton-robot
Copy link
Collaborator

@pritidesai: new pull request created: #6860

In response to this:

Since we have identified this a bug, backporting this to all active LTS releases (v0.41, v0.44, v0.47).

/cherry-pick release-v0.47.x

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.

@pritidesai
Copy link
Member Author

/cherry-pick release-v0.44.x

@pritidesai
Copy link
Member Author

/cherry-pick release-v0.41.x

@tekton-robot
Copy link
Collaborator

@pritidesai: #6850 failed to apply on top of branch "release-v0.44.x":

Applying: merge podTemplates instead of override
Using index info to reconstruct a base tree...
M	docs/pipelineruns.md
M	pkg/apis/pipeline/v1/pipelinerun_types.go
M	pkg/apis/pipeline/v1/pipelinerun_types_test.go
M	pkg/apis/pipeline/v1beta1/pipelinerun_types.go
M	pkg/apis/pipeline/v1beta1/pipelinerun_types_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/apis/pipeline/v1beta1/pipelinerun_types_test.go
Auto-merging pkg/apis/pipeline/v1beta1/pipelinerun_types.go
Auto-merging pkg/apis/pipeline/v1/pipelinerun_types_test.go
Auto-merging pkg/apis/pipeline/v1/pipelinerun_types.go
Auto-merging docs/pipelineruns.md
CONFLICT (content): Merge conflict in docs/pipelineruns.md
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 merge podTemplates instead of override
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-v0.44.x

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.

@tekton-robot
Copy link
Collaborator

@pritidesai: #6850 failed to apply on top of branch "release-v0.41.x":

Applying: merge podTemplates instead of override
Using index info to reconstruct a base tree...
M	docs/pipelineruns.md
M	pkg/apis/pipeline/v1/pipelinerun_types.go
M	pkg/apis/pipeline/v1/pipelinerun_types_test.go
M	pkg/apis/pipeline/v1beta1/pipelinerun_types.go
M	pkg/apis/pipeline/v1beta1/pipelinerun_types_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/apis/pipeline/v1beta1/pipelinerun_types_test.go
Auto-merging pkg/apis/pipeline/v1beta1/pipelinerun_types.go
Auto-merging pkg/apis/pipeline/v1/pipelinerun_types_test.go
Auto-merging pkg/apis/pipeline/v1/pipelinerun_types.go
Auto-merging docs/pipelineruns.md
CONFLICT (content): Merge conflict in docs/pipelineruns.md
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 merge podTemplates instead of override
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-v0.41.x

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is the podTemplate expected to be merged?
5 participants