Skip to content

Commit

Permalink
Add role
Browse files Browse the repository at this point in the history
  • Loading branch information
wpjunior committed Apr 9, 2024
1 parent 78ffbc8 commit 8f673f9
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
32 changes: 32 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ metadata:
creationTimestamp: null
name: manager-role
rules:
- apiGroups:
- ""
resources:
- configmaps
- pods
- secrets
- services
verbs:
- create
- delete
- get
- list
- update
- watch
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -103,6 +117,24 @@ rules:
- get
- list
- watch
- apiGroups:
- extensions.tsuru.io
resources:
- rpaasvalidations
verbs:
- get
- list
- patch
- update
- watch
- apiGroups:
- extensions.tsuru.io
resources:
- rpaasvalidations/status
verbs:
- get
- patch
- update
- apiGroups:
- keda.sh
resources:
Expand Down
8 changes: 8 additions & 0 deletions controllers/validation_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ type RpaasValidationReconciler struct {
Log logr.Logger
}

// +kubebuilder:rbac:groups="",resources=configmaps;secrets;services;pods,verbs=get;list;watch;create;update;delete
// +kubebuilder:rbac:groups="",resources=events,verbs=create;update;patch

// +kubebuilder:rbac:groups=extensions.tsuru.io,resources=rpaasflavors,verbs=get;list;watch
// +kubebuilder:rbac:groups=extensions.tsuru.io,resources=rpaasplans,verbs=get;list;watch
// +kubebuilder:rbac:groups=extensions.tsuru.io,resources=rpaasvalidations,verbs=get;list;watch;update;patch
// +kubebuilder:rbac:groups=extensions.tsuru.io,resources=rpaasvalidations/status,verbs=get;update;patch

func (r *RpaasValidationReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
validation, err := r.getRpaasValidation(ctx, req.NamespacedName)
if k8sErrors.IsNotFound(err) {
Expand Down

0 comments on commit 8f673f9

Please sign in to comment.