From 85201d86db598af5e16faa0357ee65c81f1962af Mon Sep 17 00:00:00 2001 From: Sebastian Widmer Date: Tue, 12 Mar 2024 11:43:07 +0100 Subject: [PATCH] Fix `*.user.openshift.io` RBAC (#86) Was not noticed because usage profiles require elevated permissions. --- config/rbac/role.yaml | 18 +++++++++--------- controllers/groupsync_controller.go | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 5406ca0..5796852 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -80,31 +80,31 @@ rules: - patch - update - apiGroups: - - group.openshift.io + - rbac.authorization.k8s.io resources: - - users + - clusterrolebindings verbs: - - create - - delete - get - list - - patch - - update - watch - apiGroups: - rbac.authorization.k8s.io resources: - - clusterrolebindings + - rolebindings verbs: + - create - get - list + - patch + - update - watch - apiGroups: - - rbac.authorization.k8s.io + - user.openshift.io resources: - - rolebindings + - groups verbs: - create + - delete - get - list - patch diff --git a/controllers/groupsync_controller.go b/controllers/groupsync_controller.go index a9ccd7a..312eda3 100644 --- a/controllers/groupsync_controller.go +++ b/controllers/groupsync_controller.go @@ -40,7 +40,7 @@ const OrganizationMembersManifestName = "members" const UpstreamFinalizerPrefix = "agent.appuio.io/group-zone-" -//+kubebuilder:rbac:groups=group.openshift.io,resources=users,verbs=get;list;watch;update;patch;create;delete +//+kubebuilder:rbac:groups=user.openshift.io,resources=groups,verbs=get;list;watch;update;patch;create;delete // Reconcile syncs the Group with the upstream OrganizationMembers or Team resource from the foreign (Control-API) cluster. func (r *GroupSyncReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {