Skip to content

Commit

Permalink
Add secret rbac for warden operator
Browse files Browse the repository at this point in the history
  • Loading branch information
halamix2 committed Nov 29, 2024
1 parent 0841119 commit 44a7c88
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
11 changes: 11 additions & 0 deletions charts/warden/charts/warden-operator/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ rules:
- update
- patch
- watch
- apiGroups:
- ""
resources:
- secrets
verbs:
- create
- list
- get
- update
- patch
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand Down
7 changes: 7 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ rules:
- list
- update
- watch
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- list
2 changes: 2 additions & 0 deletions internal/controllers/namespace/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package namespace

import (
"context"

"github.com/kyma-project/warden/internal/validate"
"github.com/pkg/errors"
"sigs.k8s.io/controller-runtime/pkg/predicate"
Expand Down Expand Up @@ -34,6 +35,7 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error {

//+kubebuilder:rbac:groups="",resources=pods,verbs=list;update
//+kubebuilder:rbac:groups="",resources=namespaces,verbs=watch
//+kubebuilder:rbac:groups="",resources=secrets,verbs=get;list

// Reconcile is part of the main kubernetes reconciliation loop which aims to
// move the current state of the cluster closer to the desired state.
Expand Down
1 change: 1 addition & 0 deletions internal/controllers/pod_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func (r *PodReconciler) SetupWithManager(mgr ctrl.Manager) error {

//+kubebuilder:rbac:groups="",resources=pods,verbs=get;list;watch;update
//+kubebuilder:rbac:groups="",resources=namespaces,verbs=get;list;watch
//+kubebuilder:rbac:groups="",resources=secrets,verbs=get;list

// Reconcile is part of the main kubernetes reconciliation loop which aims to
// move the current state of the cluster closer to the desired state.
Expand Down

0 comments on commit 44a7c88

Please sign in to comment.