Skip to content

Commit bb350c3

Browse files
authored
Add watch verb for storageclasses rbac (#258)
Fixes these errors: `E0804 17:31:18.410670 1 reflector.go:150] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:232: Failed to watch *v1.StorageClass: unknown (get storageclasses.storage.k8s.io)`
1 parent 0c4e50d commit bb350c3

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

charts/etcd-operator/templates/rbac/clusterrole-manager-role.yml

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ rules:
7373
verbs:
7474
- get
7575
- list
76+
- watch
7677
- apiGroups:
7778
- etcd.aenix.io
7879
resources:

config/rbac/role.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,4 @@ rules:
110110
verbs:
111111
- get
112112
- list
113+
- watch

internal/controller/etcdcluster_controller.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ type EtcdClusterReconciler struct {
7070
// +kubebuilder:rbac:groups="apps",resources=statefulsets,verbs=get;create;delete;update;patch;list;watch
7171
// +kubebuilder:rbac:groups="policy",resources=poddisruptionbudgets,verbs=get;create;delete;update;patch;list;watch
7272
// +kubebuilder:rbac:groups="",resources=persistentvolumeclaims,verbs=get;list;patch;watch
73-
// +kubebuilder:rbac:groups=storage.k8s.io,resources=storageclasses,verbs=get;list
73+
// +kubebuilder:rbac:groups=storage.k8s.io,resources=storageclasses,verbs=get;list;watch
7474

7575
// Reconcile checks CR and current cluster state and performs actions to transform current state to desired.
7676
func (r *EtcdClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {

0 commit comments

Comments
 (0)