From 32da7896de20f9be9110281090d51cf9fe7d69b4 Mon Sep 17 00:00:00 2001
From: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
Date: Thu, 17 Feb 2022 10:34:47 -0500
Subject: [PATCH] RBAC add new api's to nfd-master role

Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
---
 build/assets/master/0200_clusterrole.yaml | 16 ++++++++++++++++
 config/rbac/kustomization.yaml            | 22 ++++++++++++++++++++++
 2 files changed, 38 insertions(+)

diff --git a/build/assets/master/0200_clusterrole.yaml b/build/assets/master/0200_clusterrole.yaml
index fde18bcd..bdcab340 100644
--- a/build/assets/master/0200_clusterrole.yaml
+++ b/build/assets/master/0200_clusterrole.yaml
@@ -13,3 +13,19 @@ rules:
   - get
   - patch
   - update
+- apiGroups:
+  - topology.node.k8s.io
+  resources:
+  - noderesourcetopologies
+  verbs:
+  - create
+  - get
+  - update
+- apiGroups:
+  - nfd.k8s-sigs.io
+  resources:
+  - nodefeaturerules
+  verbs:
+  - get
+  - list
+  - watch
\ No newline at end of file
diff --git a/config/rbac/kustomization.yaml b/config/rbac/kustomization.yaml
index 8ab0a468..1805a2e1 100644
--- a/config/rbac/kustomization.yaml
+++ b/config/rbac/kustomization.yaml
@@ -33,3 +33,25 @@ patchesJSON6902:
         - use
         resourceNames:
         - nfd-worker
+    - op: add
+      path: /rules/1
+      value:
+        apiGroups:
+        - nfd.k8s-sigs.io
+        resources:
+        - nodefeaturerules
+        verbs:
+        - get
+        - list
+        - watch
+    - op: add
+      path: /rules/2
+      value:
+        apiGroups:
+        - topology.node.k8s.io
+        resources:
+        - noderesourcetopologies
+        verbs:
+        - create
+        - get
+        - update
\ No newline at end of file