Skip to content

Commit 00a0031

Browse files
synaretephlogistonjohn
authored andcommitted
controller: use rbac 'coordination.k8s.io'
Without having RBAC 'coordination.k8s.io' to samba-operator, we would get an error log-message upon 'make delete-deploy' over OpenShift, due to forbidden RBAC: "... leaderelection.go:330] error retrieving resource lock samba-operator-system/b60bd080.samba.org: leases.coordination.k8s.io "b60bd080.samba.org" is forbidden ..." Signed-off-by: Shachar Sharon <[email protected]>
1 parent bdcc4c5 commit 00a0031

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

config/rbac/role.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ rules:
2828
- patch
2929
- update
3030
- watch
31+
- apiGroups:
32+
- coordination.k8s.io
33+
resources:
34+
- leases
35+
verbs:
36+
- create
37+
- delete
38+
- get
39+
- list
40+
- update
41+
- watch
3142
- apiGroups:
3243
- ""
3344
resources:

controllers/smbshare_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ type SmbShareReconciler struct {
5050
// +kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;list;watch;create;update;patch;delete
5151
// +kubebuilder:rbac:groups=core,resources=services,verbs=get;list;watch;create;update;patch;delete
5252
// +kubebuilder:rbac:groups=core,resources=events,verbs=create
53+
// +kubebuilder:rbac:groups=coordination.k8s.io,resources=leases,verbs=get;list;watch;create;update;delete
5354

5455
//revive:enable
5556

0 commit comments

Comments
 (0)