Skip to content

Commit

Permalink
Fix RBAC policies for serviceaccount (#120)
Browse files Browse the repository at this point in the history
Signed-off-by: Max Shaposhnyk <[email protected]>
  • Loading branch information
mshaposhnik authored Jun 6, 2024
1 parent 46f3c1f commit 3c28651
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
8 changes: 8 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ rules:
- patch
- update
- watch
- apiGroups:
- ""
resources:
- serviceaccounts
verbs:
- get
- patch
- update
- apiGroups:
- appstudio.redhat.com
resources:
Expand Down
1 change: 0 additions & 1 deletion controllers/component_image_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ func (r *ComponentReconciler) SetupWithManager(mgr ctrl.Manager) error {
}

//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=components,verbs=get;list;watch;update;patch
//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=remotesecrets,verbs=get;list;watch;create
//+kubebuilder:rbac:groups="",resources=secrets,verbs=get;list;watch;create;update;patch;delete

// Reconcile is part of the main kubernetes reconciliation loop which aims to
Expand Down
2 changes: 1 addition & 1 deletion controllers/imagerepository_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ func setMetricsTime(idForMetrics string, reconcileStartTime time.Time) {
//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=imagerepositories,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=imagerepositories/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=imagerepositories/finalizers,verbs=update
//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=remotesecrets,verbs=get;list;watch;create
//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=components,verbs=get;list;watch
//+kubebuilder:rbac:groups="",resources=secrets,verbs=get;list;watch;create;update;patch
//+kubebuilder:rbac:groups="",resources=serviceaccounts,verbs=get;update;patch

func (r *ImageRepositoryReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
log := ctrllog.FromContext(ctx).WithName("ImageRepository")
Expand Down

0 comments on commit 3c28651

Please sign in to comment.