From b657fd36533d21aae2ff49aee61f1560720d86c3 Mon Sep 17 00:00:00 2001 From: Huaqing Mo Date: Fri, 15 Nov 2024 13:49:24 +0800 Subject: [PATCH] add Cluster to clusterRole --- config/rbac/role.yaml | 8 ++++++++ controllers/elfmachine_controller.go | 1 + 2 files changed, 9 insertions(+) diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 6ecd9b3..96c1169 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -15,6 +15,14 @@ rules: - patch - update - watch +- apiGroups: + - cluster.x-k8s.io + resources: + - clusters + verbs: + - get + - list + - watch - apiGroups: - cluster.x-k8s.io resources: diff --git a/controllers/elfmachine_controller.go b/controllers/elfmachine_controller.go index 6c62427..8b15f18 100644 --- a/controllers/elfmachine_controller.go +++ b/controllers/elfmachine_controller.go @@ -49,6 +49,7 @@ import ( //+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=elfmachines/status,verbs=get;update;patch //+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=elfmachines/finalizers,verbs=update //+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=elfmachinetemplates,verbs=get;list;watch +//+kubebuilder:rbac:groups=cluster.x-k8s.io,resources=clusters,verbs=get;list;watch //+kubebuilder:rbac:groups=cluster.x-k8s.io,resources=machines;machines/status,verbs=get;list;watch //+kubebuilder:rbac:groups="",resources=events,verbs=get;list;watch;create;update;patch //+kubebuilder:rbac:groups=ipam.metal3.io,resources=ippools,verbs=get;list;watch;update;patch