From 306e1ac5ab5c504adc291191cff8dd37bb45f4b8 Mon Sep 17 00:00:00 2001 From: Jian Zhu Date: Mon, 29 Apr 2024 20:52:06 +0800 Subject: [PATCH] Update import controller rbac (#681) Signed-off-by: zhujian --- config/rbac/role.yaml | 6 ++++++ .../templates/managedcluster-import-role.yaml | 6 ++++++ pkg/templates/rbac_gen.go | 1 + 3 files changed, 13 insertions(+) diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index ca3c50a4..d4ca546b 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -1655,6 +1655,12 @@ rules: - get - patch - update +- apiGroups: + - events.k8s.io + resources: + - events + verbs: + - create - apiGroups: - extensions.hive.openshift.io resources: diff --git a/pkg/templates/charts/toggle/server-foundation/templates/managedcluster-import-role.yaml b/pkg/templates/charts/toggle/server-foundation/templates/managedcluster-import-role.yaml index 877d6e8c..482d6659 100644 --- a/pkg/templates/charts/toggle/server-foundation/templates/managedcluster-import-role.yaml +++ b/pkg/templates/charts/toggle/server-foundation/templates/managedcluster-import-role.yaml @@ -256,3 +256,9 @@ rules: - create - patch - update +- apiGroups: + - events.k8s.io + resources: + - events + verbs: + - create diff --git a/pkg/templates/rbac_gen.go b/pkg/templates/rbac_gen.go index 605e7507..bfb54651 100644 --- a/pkg/templates/rbac_gen.go +++ b/pkg/templates/rbac_gen.go @@ -246,6 +246,7 @@ package main //+kubebuilder:rbac:groups=discovery.open-cluster-management.io,resources=discoveryconfigs/finalizers,verbs=get;patch;update //+kubebuilder:rbac:groups=discovery.open-cluster-management.io,resources=discoveryconfigs/status,verbs=get;patch;update //+kubebuilder:rbac:groups=discovery.open-cluster-management.io,resources=discoveryconfigs;discoveredclusters,verbs=list;watch +//+kubebuilder:rbac:groups=events.k8s.io,resources=events,verbs=create //+kubebuilder:rbac:groups=extensions.hive.openshift.io,resources=*,verbs=* //+kubebuilder:rbac:groups=extensions.hive.openshift.io,resources=agentclusterinstalls,verbs=create;delete;get;list;patch;update;watch //+kubebuilder:rbac:groups=extensions.hive.openshift.io,resources=agentclusterinstalls,verbs=get;list;watch;update