fix: use taskRunTemplate for podTemplate in Tekton v1 PipelineRuns#3871
fix: use taskRunTemplate for podTemplate in Tekton v1 PipelineRuns#3871Itx-Psycho0 wants to merge 1 commit into
Conversation
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
|
PR needs rebase. DetailsInstructions 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. |
|
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 Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Itx-Psycho0 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 |
|
Rebase it. |
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.