Skip to content

Add support for ClusterRole AggregationRule during bundle generation #6978

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zimnx
Copy link

@zimnx zimnx commented Aug 5, 2025

Description of the change:

ClusterRoles that use an AggregationRule often do not have any rules defined directly. Instead, their rules are aggregated from other ClusterRoles that match the AggregationRule’s label selector.

The existing generator logic only included rules from ClusterRoles that were explicitly bound via ClusterRoleBindings to the ServiceAccounts used by Deployments. Since ClusterRoles with an AggregationRule typically lack direct rule definitions, the resulting permission bundle ended up being empty.

Motivation for the change:

Improve user experience of bundle generator for users using ClusterRole AggregationRule.

Checklist

If the pull request includes user-facing changes, extra documentation is required:

Fixes #6977

@mykaul
Copy link

mykaul commented Aug 10, 2025

@zimnx - please sign the DCO.

ClusterRoles that use an AggregationRule often do not have any rules
defined directly. Instead, their rules are aggregated from other
ClusterRoles that match the AggregationRule’s label selector.

The existing generator logic only included rules from ClusterRoles that
were explicitly bound via ClusterRoleBindings to the ServiceAccounts
used by Deployments. Since ClusterRoles with an AggregationRule
typically lack direct rule definitions, the resulting permission bundle
ended up being empty.

This update adds support for handling ClusterRoles that use an
AggregationRule.

Signed-off-by: Maciej Zimnoch <[email protected]>
@zimnx zimnx force-pushed the support-aggregated-clusterroles branch from 8141b30 to 0ac4a86 Compare August 11, 2025 07:55
@zimnx
Copy link
Author

zimnx commented Aug 11, 2025

@zimnx - please sign the DCO.

Done

@jberkhahn @rashmigottipati Kind reminder about this PR, I would appreciate feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rules of ClusterRoles with AggregationRule are not included in generated bundle permissions
2 participants