chore(makefile): support to generate rbac in make manifests#209
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the management of Kubernetes RBAC roles for the controller by introducing automated generation. It ensures that the controller's required permissions are always up-to-date with its code annotations and are correctly packaged within the Helm chart for deployment. This change enhances maintainability and reduces the potential for manual errors in RBAC configuration. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request is a great improvement, automating RBAC manifest generation from controller-gen markers. This enhances maintainability and ensures permissions stay in sync with code. My review focuses on the RBAC markers themselves. I've found a recurring issue where status subresources (*/status) are granted excessive permissions like create, delete, list, and watch. These verbs are generally not applicable to status subresources. I've provided suggestions to scope down these permissions to follow the principle of least privilege.
- config/rbac/kustomization.yaml: update rbgs_controller_role.yaml to role.yaml (renamed in sgl-project#209 but reference not updated, breaking kustomize build) - config/crd/kustomization.yaml: add 5 missing CRD resources (coordinatedpolicies, instances, instancesets, roleinstances, roleinstancesets) - Regenerate deploy/kubectl/manifests.yaml and config/manager/kustomization.yaml via make build-installer
- config/rbac/kustomization.yaml: update rbgs_controller_role.yaml to role.yaml (renamed in sgl-project#209 but reference not updated, breaking kustomize build) - config/crd/kustomization.yaml: add 5 missing CRD resources (coordinatedpolicies, instances, instancesets, roleinstances, roleinstancesets) - Regenerate deploy/kubectl/manifests.yaml and config/manager/kustomization.yaml via make build-installer
- config/rbac/kustomization.yaml: update rbgs_controller_role.yaml to role.yaml (renamed in sgl-project#209 but reference not updated, breaking kustomize build) - config/crd/kustomization.yaml: add 5 missing CRD resources (coordinatedpolicies, instances, instancesets, roleinstances, roleinstancesets) - Regenerate deploy/kubectl/manifests.yaml and config/manager/kustomization.yaml via make build-installer
- config/rbac/kustomization.yaml: update rbgs_controller_role.yaml to role.yaml (renamed in sgl-project#209 but reference not updated, breaking kustomize build) - config/crd/kustomization.yaml: add the instances and instancesets CRDs that were missing from the resources list, and sort entries alphabetically - Regenerate deploy/kubectl/manifests.yaml to reflect the two fixes above
Ⅰ. Motivation
Ⅱ. Modifications
Ⅲ. Does this pull request fix one issue?
fixes #XXXX
Ⅳ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅴ. Describe how to verify it
VI. Special notes for reviews
Checklist
make fmt.