fix(helm): add RBAC conditional toggles for controller and gateway ClusterRole resources#3750
Open
lexburner wants to merge 2 commits intohigress-group:mainfrom
Open
fix(helm): add RBAC conditional toggles for controller and gateway ClusterRole resources#3750lexburner wants to merge 2 commits intohigress-group:mainfrom
lexburner wants to merge 2 commits intohigress-group:mainfrom
Conversation
…usterRole resources - Add controller.rbac.create toggle to control ClusterRole/ClusterRoleBinding creation - Add gateway.rbac.create toggle to independently control gateway cluster-level RBAC - Separate functional toggle (gateway.rbac.enabled) from permission toggle (gateway.rbac.create) - Update English and Chinese documentation in README.md and README.zh.md - All changes are backward compatible with default values preserving existing behavior
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…EADME generation - Add '# --' comment to controller.rbac.create in values.yaml for helm-docs - Regenerate README.md using helm-docs v1.14.2 to match CI expectations
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.
Ⅰ. Describe what this PR did
Fix the issue where
controller.rbac.createwas defined invalues.yamlbut not referenced in any controller RBAC templates, and add fine-grained RBAC toggle support for both controller and gateway components.Changes:
controller ClusterRole/ClusterRoleBinding: Add
{{- if .Values.controller.rbac.create }}conditional tocontroller-clusterrole.yamlandcontroller-clusterrolebinding.yaml, so thatcontroller.rbac.create(which already existed invalues.yamlbut was never used) now actually controls whether these cluster-level resources are created.controller Role/RoleBinding: Keep these unconditionally created (removed any conditional), since namespace admins always have permission to manage namespace-scoped RBAC resources.
gateway ClusterRole/ClusterRoleBinding: Add a new
gateway.rbac.createtoggle (defaulttrue) alongside the existinggateway.rbac.enabled. Theenabledflag controls whether the RBAC resources are functionally needed (not needed for Gateway API), whilecreatecontrols whether the cluster-level resources should be created by Helm (set tofalsewhen pre-provisioned by a cluster admin).Documentation: Update both
README.mdandREADME.zh.mdwith accurate descriptions for all RBAC toggles.All changes are backward compatible — default values preserve existing behavior.
Ⅱ. Does this pull request fix one issue?
fixes #3749
Ⅲ. Why don't you add test cases (unit test/integration test)?
This change only modifies Helm templates and documentation. The conditional logic uses standard Helm
{{- if }}directives with boolean values, which can be verified byhelm templaterendering.Ⅳ. Describe how to verify it
helm templatewith default values — output should be identical to before (all RBAC resources created)helm template --set controller.rbac.create=false— controller ClusterRole and ClusterRoleBinding should be absenthelm template --set gateway.rbac.create=false— gateway ClusterRole and ClusterRoleBinding should be absent, while gateway Role and RoleBinding remain (ifgateway.rbac.enabled=true)Ⅴ. Special notes for reviews
controller.rbac.createalready existed invalues.yamlbut was never referenced in templates — this was the original buggateway.rbac.enabled(functional need) vsgateway.rbac.create(permission to create cluster-level resources) addresses two distinct concernsⅥ. AI Coding Tool Usage Checklist (if applicable)
AI Coding Prompts (for regular updates)
controller.rbac.createin values.yaml was not referenced in controller RBAC templatesAI Coding Summary
controller.rbac.createtoggle by adding conditionals to ClusterRole/ClusterRoleBinding templatesgateway.rbac.createto separate functional need from deployment permission concerns