Skip to content

Commit

Permalink
Add missing RBAC for alertmanagerconfigs and outboundwebhooks
Browse files Browse the repository at this point in the history
  • Loading branch information
assafad1 committed Sep 22, 2024
1 parent b8f0604 commit 530d003
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
33 changes: 20 additions & 13 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: manager-role
rules:
- apiGroups:
Expand Down Expand Up @@ -34,7 +33,7 @@ rules:
- apiGroups:
- coralogix.com
resources:
- recordingrulegroupsets
- outboundwebhooks
verbs:
- create
- delete
Expand All @@ -46,21 +45,21 @@ rules:
- apiGroups:
- coralogix.com
resources:
- recordingrulegroupsets/finalizers
- outboundwebhooks/finalizers
verbs:
- update
- apiGroups:
- coralogix.com
resources:
- recordingrulegroupsets/status
- outboundwebhooks/status
verbs:
- get
- patch
- update
- apiGroups:
- coralogix.com
resources:
- rulegroups
- recordingrulegroupsets
verbs:
- create
- delete
Expand All @@ -72,21 +71,21 @@ rules:
- apiGroups:
- coralogix.com
resources:
- rulegroups/finalizers
- recordingrulegroupsets/finalizers
verbs:
- update
- apiGroups:
- coralogix.com
resources:
- rulegroups/status
- recordingrulegroupsets/status
verbs:
- get
- patch
- update
- apiGroups:
- coralogix.coralogix.com
- coralogix.com
resources:
- outboundwebhooks
- rulegroups
verbs:
- create
- delete
Expand All @@ -96,19 +95,27 @@ rules:
- update
- watch
- apiGroups:
- coralogix.coralogix.com
- coralogix.com
resources:
- outboundwebhooks/finalizers
- rulegroups/finalizers
verbs:
- update
- apiGroups:
- coralogix.coralogix.com
- coralogix.com
resources:
- outboundwebhooks/status
- rulegroups/status
verbs:
- get
- patch
- update
- apiGroups:
- monitoring.coreos.com
resources:
- alertmanagerconfigs
verbs:
- get
- list
- watch
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down
1 change: 1 addition & 0 deletions controllers/alertmanagerconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
)

//+kubebuilder:rbac:groups=monitoring.coreos.com,resources=prometheusrules,verbs=get;list;watch
//+kubebuilder:rbac:groups=monitoring.coreos.com,resources=alertmanagerconfigs,verbs=get;list;watch

//+kubebuilder:rbac:groups=coralogix.com,resources=recordingrulegroupsets,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=coralogix.com,resources=recordingrulegroupsets/status,verbs=get;update;patch
Expand Down
6 changes: 3 additions & 3 deletions controllers/alphacontrollers/outboundwebhook_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ type OutboundWebhookReconciler struct {
Scheme *runtime.Scheme
}

//+kubebuilder:rbac:groups=coralogix.coralogix.com,resources=outboundwebhooks,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=coralogix.coralogix.com,resources=outboundwebhooks/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=coralogix.coralogix.com,resources=outboundwebhooks/finalizers,verbs=update
//+kubebuilder:rbac:groups=coralogix.com,resources=outboundwebhooks,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=coralogix.com,resources=outboundwebhooks/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=coralogix.com,resources=outboundwebhooks/finalizers,verbs=update

var (
outboundWebhookFinalizerName = "outbound-webhook.coralogix.com/finalizer"
Expand Down

0 comments on commit 530d003

Please sign in to comment.