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 RBAC permission on openshift #884

Merged
merged 1 commit into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
* Set default MySQL server version to `5.7.35`
* Bump Orchestrator to `3.2.6`
* Change policy/v1beta1 to policy/v1
* Add RBAC permissions when deploying on OpenShift

### Removed

Expand Down
3 changes: 3 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ rules:
- mysql.presslabs.org
resources:
- mysqlbackups
- mysqlbackups/finalizers
- mysqlbackups/status
verbs:
- create
Expand All @@ -89,6 +90,7 @@ rules:
- mysql.presslabs.org
resources:
- mysqlclusters
- mysqlclusters/finalizers
- mysqlclusters/status
verbs:
- create
Expand All @@ -102,6 +104,7 @@ rules:
- mysql.presslabs.org
resources:
- mysqldatabases
- mysqldatabases/finalizers
- mysqldatabases/status
verbs:
- create
Expand Down
3 changes: 3 additions & 0 deletions deploy/charts/mysql-operator/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ rules:
- mysql.presslabs.org
resources:
- mysqlbackups
- mysqlbackups/finalizers
- mysqlbackups/status
verbs:
- create
Expand All @@ -89,6 +90,7 @@ rules:
- mysql.presslabs.org
resources:
- mysqlclusters
- mysqlclusters/finalizers
- mysqlclusters/status
verbs:
- create
Expand All @@ -102,6 +104,7 @@ rules:
- mysql.presslabs.org
resources:
- mysqldatabases
- mysqldatabases/finalizers
- mysqldatabases/status
verbs:
- create
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/mysqlbackup/mysqlbackup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ type ReconcileMysqlBackup struct {

// Automatically generate RBAC rules to allow the Controller to read and write Deployments
// +kubebuilder:rbac:groups=batch,resources=jobs,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=mysql.presslabs.org,resources=mysqlbackups;mysqlbackups/status,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=mysql.presslabs.org,resources=mysqlbackups;mysqlbackups/status;mysqlbackups/finalizers,verbs=get;list;watch;create;update;patch;delete

// Reconcile reads that state of the cluster for a MysqlBackup object and makes changes based on the state read
// and what is in the MysqlBackup.Spec
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/mysqlcluster/mysqlcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ type ReconcileMysqlCluster struct {
// Automatically generate RBAC rules to allow the Controller to read and write Deployments
// +kubebuilder:rbac:groups=apps,resources=statefulsets,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=core,resources=configmaps;secrets;services;events;jobs;pods;persistentvolumeclaims,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=mysql.presslabs.org,resources=mysqlclusters;mysqlclusters/status,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=mysql.presslabs.org,resources=mysqlclusters;mysqlclusters/status;mysqlclusters/finalizers,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=policy,resources=poddisruptionbudgets,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=coordination.k8s.io,resources=leases,verbs=get;list;watch;create;update;patch;delete

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/mysqldatabase/db_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ type ReconcileMySQLDatabase struct {
var _ reconcile.Reconciler = &ReconcileMySQLDatabase{}

// Automatically generate RBAC rules to allow the Controller to read and write Deployments
// +kubebuilder:rbac:groups=mysql.presslabs.org,resources=mysqldatabases;mysqldatabases/status,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=mysql.presslabs.org,resources=mysqldatabases;mysqldatabases/status;mysqldatabases/finalizers,verbs=get;list;watch;create;update;patch;delete

// Reconcile reads that state of the cluster for a Wordpress object and makes changes based on the state read
// and what is in the Wordpress.Spec
Expand Down