From fc757da6a522a1daf73ab5504cceaeb2a7caa63b Mon Sep 17 00:00:00 2001 From: Andrei Kvapil Date: Tue, 24 Sep 2024 13:42:52 +0200 Subject: [PATCH] Add watch verb for storageclasses --- .../etcd-operator/templates/rbac/clusterrole-manager-role.yml | 1 + config/rbac/role.yaml | 1 + internal/controller/etcdcluster_controller.go | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/etcd-operator/templates/rbac/clusterrole-manager-role.yml b/charts/etcd-operator/templates/rbac/clusterrole-manager-role.yml index 534e00ad..825c726c 100644 --- a/charts/etcd-operator/templates/rbac/clusterrole-manager-role.yml +++ b/charts/etcd-operator/templates/rbac/clusterrole-manager-role.yml @@ -73,6 +73,7 @@ rules: verbs: - get - list + - watch - apiGroups: - etcd.aenix.io resources: diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 00d63f4c..3ae03b0d 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -110,3 +110,4 @@ rules: verbs: - get - list + - watch diff --git a/internal/controller/etcdcluster_controller.go b/internal/controller/etcdcluster_controller.go index b1df270f..f4ec6eca 100644 --- a/internal/controller/etcdcluster_controller.go +++ b/internal/controller/etcdcluster_controller.go @@ -70,7 +70,7 @@ type EtcdClusterReconciler struct { // +kubebuilder:rbac:groups="apps",resources=statefulsets,verbs=get;create;delete;update;patch;list;watch // +kubebuilder:rbac:groups="policy",resources=poddisruptionbudgets,verbs=get;create;delete;update;patch;list;watch // +kubebuilder:rbac:groups="",resources=persistentvolumeclaims,verbs=get;list;patch;watch -// +kubebuilder:rbac:groups=storage.k8s.io,resources=storageclasses,verbs=get;list +// +kubebuilder:rbac:groups=storage.k8s.io,resources=storageclasses,verbs=get;list;watch // Reconcile checks CR and current cluster state and performs actions to transform current state to desired. func (r *EtcdClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {