refactor(helm): remove rbac.clusterScoped, derive RBAC scope from rbac.namespaces#1728
Merged
EItanya merged 4 commits intokagent-dev:mainfrom Apr 22, 2026
Merged
Conversation
Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the Helm chart’s RBAC configuration to derive RBAC scope solely from rbac.namespaces, removing the redundant rbac.clusterScoped flag and adding explicit guardrails to prevent ambiguous or silently-changing configurations.
Changes:
- Remove
rbac.clusterScopedand make RBAC scope depend only on whetherrbac.namespacesis empty vs non-empty. - Add Helm template validation to fail rendering if
rbac.clusterScopedis set or ifrbac.namespacesomits the install namespace. - Update Helm unit tests and CI workflow to match the new RBAC configuration semantics, including deriving
WATCH_NAMESPACESfromrbac.namespaces.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
helm/kagent/values.yaml |
Updates user-facing RBAC values documentation to rely on rbac.namespaces only. |
helm/kagent/tests/rbac_test.yaml |
Updates/extends RBAC rendering tests and adds failure-guard tests. |
helm/kagent/tests/controller-deployment_test.yaml |
Adds tests ensuring WATCH_NAMESPACES derives from rbac.namespaces unless explicitly overridden. |
helm/kagent/templates/rbac/writer-rolebinding.yaml |
Switches RBAC rendering logic to key off rbac.namespaces and adds validation include. |
helm/kagent/templates/rbac/writer-role.yaml |
Same RBAC scope refactor + validation include for writer Role/ClusterRole. |
helm/kagent/templates/rbac/getter-rolebinding.yaml |
Same RBAC scope refactor + validation include for getter RoleBinding/ClusterRoleBinding. |
helm/kagent/templates/rbac/getter-role.yaml |
Same RBAC scope refactor + validation include for getter Role/ClusterRole. |
helm/kagent/templates/_helpers.tpl |
Updates watch namespace derivation precedence and adds kagent.rbac.validate guards. |
.github/workflows/ci.yaml |
Removes usage of the deleted rbac.clusterScoped flag in e2e workflow overrides. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Jet Chiang <jetjiang.ez@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Jet Chiang <jetjiang.ez@gmail.com>
EItanya
approved these changes
Apr 22, 2026
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.
Collapses the redundant
rbac.clusterScopedboolean intorbac.namespacesalone. Empty list createsClusterRole/ClusterRoleBinding(default, unchanged), non-empty list creates namespacedRole/RoleBindingper listed namespace plus auto-derived WATCH_NAMESPACES. Adds helm fail guards so setting the removed field or omitting the install namespace fromrbac.namespaceserrors loudly instead of silently changing scope. This avoids confusion when the user seesclusterScoped: truebutnamespaces: [a, b, c]