fix(testkube-runner): grant CRD read to listener-capable agents - #8034
Open
dejanzele wants to merge 1 commit into
Open
fix(testkube-runner): grant CRD read to listener-capable agents#8034dejanzele wants to merge 1 commit into
dejanzele wants to merge 1 commit into
Conversation
Contributor
Greptile SummaryAdds conditionally rendered ClusterRole and ClusterRoleBinding resources granting listener- or GitOps-capable runner agents read access to Kubernetes CRDs.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (2): Last reviewed commit: "fix(testkube-runner): grant CRD read to ..." | Re-trigger Greptile |
dejanzele
force-pushed
the
fix/runner-crd-rbac-listener-scoped
branch
from
July 30, 2026 08:27
5c9709b to
8928f7e
Compare
Contributor
Author
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.
How
The
testkube-runnerchart never grantedapiextensions.k8s.io/customresourcedefinitions, so agents deployed from it log a recurringFailed to watch ... CustomResourceDefinition ... forbiddenand retry forever. The siblingtestkube-apichart has hadcrd-reader-rbac.yamlfor this; the runner chart did not.Adds the equivalent ClusterRole and ClusterRoleBinding, scoped to the same
listener.enabled or gitops.enabledcondition that already gateswatchers-role, and topod.serviceAccount.autoCreatelike the rest of the chart's RBAC.Scoped rather than unconditional because a runner-only agent has no reason to hold cluster-wide read on every CRD in the cluster. It never starts the CRD informer once #8033 lands, and the Control Plane refuses its inventory push regardless. The two conditions cover both worlds: against a capability-reporting control plane
listener.enabledis what earns the agent the listener capability, and against an older onegitops.enabledis what trips the agent's local fallback.This supersedes #8023, which grants the same access to every runner unconditionally.
A
crd_reader_rbac_test.yamlsuite covers the gate in both directions, the rule contents, and the binding subject. Chart suite goes from 8 files / 75 tests to 9 / 83.Note for review
The ClusterRole is named
crd-reader-{{ .Release.Name }}, matching the one intestkube-api. Two releases sharing a name would collide on this cluster-scoped object. The existingwatchers-role-{{ .Release.Name }}has the same exposure, so this follows the chart family's convention rather than diverging, but it is worth deciding deliberately.