Skip to content

Commit

Permalink
Added rule to ClusterRole
Browse files Browse the repository at this point in the history
We need to modify the ClusterRole to grant the required permissions for the manager pod to access the /metrics endpoint. This is essential for e2e testing, as we will run curl commands from within the manager container to interact with the endpoint.

Signed-off-by: Ronny Baturov <[email protected]>
  • Loading branch information
rbaturov committed Oct 7, 2024
1 parent 0579a2e commit d078332
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ metadata:
}
]
capabilities: Basic Install
createdAt: "2024-09-25T14:08:22Z"
createdAt: "2024-10-07T13:25:30Z"
olm.skipRange: '>=4.17.0 <4.18.0'
operators.operatorframework.io/builder: operator-sdk-v1.36.1
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
Expand Down Expand Up @@ -338,6 +338,10 @@ spec:
spec:
clusterPermissions:
- rules:
- nonResourceURLs:
- /metrics
verbs:
- get
- apiGroups:
- ""
resources:
Expand Down
4 changes: 4 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ kind: ClusterRole
metadata:
name: manager-role
rules:
- nonResourceURLs:
- /metrics
verbs:
- get
- apiGroups:
- ""
resources:
Expand Down
1 change: 1 addition & 0 deletions controllers/numaresourcesoperator_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ type NUMAResourcesOperatorReconciler struct {
//+kubebuilder:rbac:groups=nodetopology.openshift.io,resources=numaresourcesoperators,verbs=*
//+kubebuilder:rbac:groups=nodetopology.openshift.io,resources=numaresourcesoperators/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=nodetopology.openshift.io,resources=numaresourcesoperators/finalizers,verbs=update
// +kubebuilder:rbac:urls=/metrics,verbs=get

// 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 d078332

Please sign in to comment.