Skip to content
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

Add support for ClusterRule aggregationRule #310

Merged
merged 2 commits into from
Sep 14, 2024

Conversation

jordiprats
Copy link
Contributor

This PR fixes: #309

This takes into consideration the roles that are used to generate other roles so that they are not marked as unused as per aggregated-clusterroles

@jordiprats
Copy link
Contributor Author

@derailed is there anything you want me to change or clarify?

Copy link
Owner

@derailed derailed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jordiprats Great catch! Thank you for these updates!!
Please see review comments

@@ -76,6 +78,16 @@ func (s *ClusterRole) checkStale(ctx context.Context, refs *sync.Map) {
if s.system.skip(fqn) {
continue
}
partialRole := false
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: prefer using the zero value aka var partialRole bool

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, same functionality. I can change that

internal/cache/cr.go Show resolved Hide resolved
Copy link
Owner

@derailed derailed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jordiprats Thank you for the updates! I think we should support matchExp.
We can add in a subsequent PR

@derailed derailed merged commit c7148a7 into derailed:master Sep 14, 2024
1 of 2 checks passed
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.

Parts of aggregated ClusterRoles are being highlighted as unused
2 participants