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

Improve how we specify rbac settings for controllers #100

Open
carolynvs opened this issue May 4, 2022 · 0 comments
Open

Improve how we specify rbac settings for controllers #100

carolynvs opened this issue May 4, 2022 · 0 comments
Labels
2 - 🍕 Pizza should be eaten daily

Comments

@carolynvs
Copy link
Member

Each controller is duplicating the rbac settings from other controllers. e.g. the installation controller is setting RBAC values for resources that it doesn't manage itself (these are managed by the agent action controller)

// +kubebuilder:rbac:groups=porter.sh,resources=agentconfigs,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=porter.sh,resources=porterconfigs,verbs=get;list;watch;create;update;patch;delete
// ...
// +kubebuilder:rbac:groups=batch,resources=jobs,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups="",resources=secrets,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups="",resources=persistentvolumeclaims,verbs=get;list;watch;create;update;patch;delete

Really the installation controller (and the others when we create them) should only have entries for new permissions that the controller needs. So the installation controller would only specify the following:

// +kubebuilder:rbac:groups=porter.sh,resources=installations,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=porter.sh,resources=installations/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=porter.sh,resources=installations/finalizers,verbs=update;patch
@getporterbot getporterbot added this to Inbox in Porter and Mixins May 4, 2022
@VinozzZ VinozzZ added this to the v1 milestone Dec 21, 2022
@carolynvs carolynvs removed this from the v1 milestone Feb 2, 2023
@carolynvs carolynvs added the 2 - 🍕 Pizza should be eaten daily label Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 - 🍕 Pizza should be eaten daily
Projects
Development

No branches or pull requests

2 participants