Skip to content

Commit

Permalink
Fix rbac configuration to access lease resource (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenny Scharm authored Apr 15, 2021
1 parent ecab38e commit f801f66
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ rules:
- get
- patch
- update
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- create
- delete
- get
- list
- update
- watch
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down
1 change: 1 addition & 0 deletions pkg/varnishcluster/controller/varnishcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ func NewVarnishReconciler(mgr manager.Manager, cfg *config.Config, logr *logger.
// +kubebuilder:rbac:groups=policy,resources=poddisruptionbudgets,verbs=list;watch;create;update;delete
// +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=roles;rolebindings;clusterroles;clusterrolebindings,verbs=list;watch;create;update;delete
// +kubebuilder:rbac:groups=monitoring.coreos.com,resources=servicemonitors,verbs=get;list;watch;create;update;delete
// +kubebuilder:rbac:groups=coordination.k8s.io,resources=leases,verbs=get;list;watch;create;update;delete

func (r *ReconcileVarnishCluster) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error) {
logr := r.logger.With(logger.FieldVarnishCluster, request.Name)
Expand Down
11 changes: 11 additions & 0 deletions varnish-operator/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ rules:
- get
- patch
- update
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- create
- delete
- get
- list
- update
- watch
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down

0 comments on commit f801f66

Please sign in to comment.