Skip to content

Commit

Permalink
fix: grant operator permission to manage cluster roles
Browse files Browse the repository at this point in the history
Support for volume expansion required adding the patch verb to the driver’s ClusterRole. To enable seamless upgrades from v1.6 to v1.7, the operator now requires permission to update ClusterRoles.
  • Loading branch information
iamjoemccormick committed Nov 1, 2024
1 parent 61baa3e commit 8307661
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,6 @@ spec:
- rbac.authorization.k8s.io
resources:
- clusterrolebindings
- clusterroles
- rolebindings
- roles
verbs:
Expand All @@ -510,6 +509,17 @@ spec:
- get
- list
- watch
- apiGroups:
- rbac.authorization.k8s.io
resources:
- clusterroles
verbs:
- create
- delete
- get
- list
- update
- watch
- apiGroups:
- security.openshift.io
resourceNames:
Expand Down
12 changes: 11 additions & 1 deletion operator/config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ rules:
- rbac.authorization.k8s.io
resources:
- clusterrolebindings
- clusterroles
- rolebindings
- roles
verbs:
Expand All @@ -111,6 +110,17 @@ rules:
- get
- list
- watch
- apiGroups:
- rbac.authorization.k8s.io
resources:
- clusterroles
verbs:
- create
- delete
- get
- list
- update
- watch
- apiGroups:
- security.openshift.io
resourceNames:
Expand Down
2 changes: 1 addition & 1 deletion operator/controllers/beegfsdriver_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type BeegfsDriverReconciler struct {

// The operator must have the following permissions to deploy the driver.
//+kubebuilder:rbac:groups=core,resources=serviceaccounts,verbs=get;list;watch;create
//+kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterroles,verbs=get;list;watch;create;delete
//+kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterroles,verbs=get;list;watch;create;delete;update
//+kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterrolebindings,verbs=get;list;watch;create;delete
//+kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=roles,verbs=get;list;watch;create;delete
//+kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=rolebindings,verbs=get;list;watch;create;delete
Expand Down

0 comments on commit 8307661

Please sign in to comment.