Skip to content

fix: use taskRunTemplate for podTemplate in Tekton v1 PipelineRuns#3871

Open
Itx-Psycho0 wants to merge 1 commit into
knative:mainfrom
Itx-Psycho0:fix/3665-tekton-v1-taskruntemplate
Open

fix: use taskRunTemplate for podTemplate in Tekton v1 PipelineRuns#3871
Itx-Psycho0 wants to merge 1 commit into
knative:mainfrom
Itx-Psycho0:fix/3665-tekton-v1-taskruntemplate

Conversation

@Itx-Psycho0
Copy link
Copy Markdown
Contributor

Hey team,

I'm fixing an issue with PR #3665 that @matejvasek pointed out - the security context isn't actually being applied on KinD or OCP clusters.

What's wrong:

PR #3665 added podTemplate with securityContext to fix FSGroup permission issues on s390x/ppc64le. But it put podTemplate directly under spec, which is the old v1beta1 syntax. Since our templates use apiVersion: tekton.dev/v1, Kubernetes just ignores that field completely.

The fix:

In Tekton v1, podTemplate needs to be nested under taskRunTemplate. I've moved it to the right place in all four PipelineRun templates (Pack and S2I, both regular and PAC versions).

Before:

spec:
podTemplate:
securityContext:
fsGroup: 1002

After:

spec:
taskRunTemplate:
podTemplate:
securityContext:
fsGroup: 1002

This matches the official Tekton v1 docs: https://tekton.dev/docs/pipelines/pipelineruns/#specifying-a-pod-template

Testing:

All tests pass
make check is clean
Test now verifies taskRunTemplate is present
This should fix the issue where the security context wasn't being applied.

PR knative#3665 added podTemplate with securityContext to fix s390x/ppc64le
FSGroup issues, but used the v1beta1 API syntax (spec.podTemplate)
instead of the v1 API syntax (spec.taskRunTemplate.podTemplate).

This caused the podTemplate field to be silently ignored by Kubernetes,
making the fix ineffective on both KinD and OCP clusters.

Changes:
- Move podTemplate under taskRunTemplate in packRunTemplate
- Move podTemplate under taskRunTemplate in packRunTemplatePAC
- Move podTemplate under taskRunTemplate in s2iRunTemplate
- Move podTemplate under taskRunTemplate in s2iRunTemplatePAC
- Update test to verify taskRunTemplate is present

This follows the Tekton v1 API migration guide:
https://tekton.dev/docs/pipelines/migrating-v1beta1-to-v1/

Fixes the issue reported by @matejvasek in PR knative#3665 where the
security context was not being applied on KinD or OCP.

Related: knative#3665, knative#3515, knative#3781
@knative-prow-robot
Copy link
Copy Markdown

PR needs rebase.

Details

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-sigs/prow repository.

@knative-prow-robot knative-prow-robot added the needs-rebase Cannot be merged due to conflicts with HEAD. label Jun 1, 2026
@knative-prow knative-prow Bot added size/M 🤖 PR changes 30-99 lines, ignoring generated files. needs-ok-to-test 🤖 Needs an org member to approve testing labels Jun 1, 2026
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented Jun 1, 2026

Hi @Itx-Psycho0. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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-sigs/prow repository.

@knative-prow knative-prow Bot requested review from dsimansk and jrangelramos June 1, 2026 16:57
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented Jun 1, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Itx-Psycho0
Once this PR has been reviewed and has the lgtm label, please assign matejvasek for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details 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

@matejvasek
Copy link
Copy Markdown
Contributor

Rebase it.

@lkingland lkingland added the status/new Accepted to Traige label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ok-to-test 🤖 Needs an org member to approve testing needs-rebase Cannot be merged due to conflicts with HEAD. size/M 🤖 PR changes 30-99 lines, ignoring generated files. status/new Accepted to Traige

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants