Skip to content

Commit

Permalink
fix: enable impersonation of serviceaccounts
Browse files Browse the repository at this point in the history
  • Loading branch information
dvirgilad committed Dec 4, 2024
1 parent 285a0ca commit 1275232
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/hns/templates/manager-rbac-clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ rules:
- ""
resources:
- users
- serviceaccounts
verbs:
- impersonate
- apiGroups:
Expand Down
1 change: 1 addition & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ rules:
- ""
resources:
- users
- serviceaccounts
verbs:
- impersonate
- apiGroups:
Expand Down
1 change: 1 addition & 0 deletions internal/migrationhierarchy/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type MigrationHierarchyReconciler struct {
// +kubebuilder:rbac:groups=dana.hns.io,resources=migrationhierarchies,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=dana.hns.io,resources=migrationhierarchies/status,verbs=get;update;patch
// +kubebuilder:rbac:groups="",resources=users,verbs=impersonate
// +kubebuilder:rbac:groups="",resources=serviceaccounts,verbs=impersonate

func (r *MigrationHierarchyReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
Expand Down
1 change: 1 addition & 0 deletions internal/updatequota/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type UpdateQuotaReconciler struct {
// +kubebuilder:rbac:groups=dana.hns.io,resources=updatequota/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=user.openshift.io,resources=groups,verbs=get;list;watch
// +kubebuilder:rbac:groups="",resources=users,verbs=impersonate
// +kubebuilder:rbac:groups="",resources=serviceaccounts,verbs=impersonate

func (r *UpdateQuotaReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
Expand Down

0 comments on commit 1275232

Please sign in to comment.