Skip to content

Commit

Permalink
Add secret rbac for warden operator (#352) (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
halamix2 authored Nov 29, 2024
1 parent a5cfa46 commit 5bfbd10
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
8 changes: 8 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,14 @@ rules:
- update
- patch
- watch
- apiGroups:
- ""
resources:
- secrets
verbs:
- list
- get
- 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 5bfbd10

Please sign in to comment.