Closed ottlngr closed 9 months ago
Thanks for reporting this @ottlngr, it does indeed look like a bug.
I think this is kind of a RBAC problem, but not sure how to tackle it sustainably
It's not related to RBAC. Instead it's due to differences between the v1beta1 and v1 versions for the PipelineRun resource. See https://tekton.dev/docs/pipelines/pipelineruns/#mapping-serviceaccount-credentials-to-tasks
In v1beta1 the ServiceAccount name is set on spec.serviceAccountName
, but in v1 it's spec.taskRunTemplate.serviceAccountName
.
The code for import resources already takes this into account but the create PipelineRun does not and will need to be updated to check the version being used.
I've fixed this locally and will get a PR open by end of day. I'll aim to do a patch release early next week. Thanks again for reporting the issue.
@ottlngr In the meantime you can workaround the problem by switching the Dashboard back to use the v1beta1 APIs. You can find the toggle for this on the settings page, Use Tekton Pipelines API version v1
, turning this off reverts to v1beta1 where applicable.
This is fixed in Dashboard v0.43.1 LTS, and nightly release v20240205-376e6c2046
or later.
This version is included in Operator nightly release v20240208-66069b9d82
or later, and should be included in the next Operator release (v0.70).
Expected behavior
A PipelineRun created by using Tekton Dashboard is not rejected by the admission controller when selecting a service account for the PipelineRun.
Actual behaviour
When creating a PipelineRun using Tekton Dashboard for an existing Pipeline, selecting a service account leads the admission controller to reject the PipelineRun with error:
Steps to reproduce the bug
Optional values > Service Account
Additional info
Kubernetes version:
Output of
kubectl version
:Tekton versions:
Output of
tkn version
orAdd any other useful context about the problem here:
tekton-pipelines
Pipeline
resource as well as the respective service account reside in the same but different namespace thentekton-pipelines
PipelineRun
usingtkn
CLI for the same combination ofPipeline
and service accounts succeeds