build: fix csi nfs rbac csv generation

Added hack in generate-rook-csv for proper
generation of csi nfs rbac in csv.
Added placeholder clusterrole and binding for
nfs nodeplugin sa, since operator-sdk
does not include sa without rules.

Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
Rakshith R committed 2022-04-28 19:42:24 +05:30
1 parent 3005a6fc68
commit d0b67af23b
4 files changed
+63

No files matched your search

@@ -428,6 +428,21 @@ rules:
resources: ["secrets"]
verbs: ["get"]
---
# TODO: remove this, once https://github.com/rook/rook/issues/10141
# is resolved.
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ceph-nfs-csi-nodeplugin
labels:
operator: rook
storage-backend: ceph
{{- include "library.rook-ceph.labels" . | nindent 4 }}
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get"]
---
{{ end }}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
@@ -101,6 +101,21 @@ roleRef:
name: ceph-nfs-external-provisioner-runner
apiGroup: rbac.authorization.k8s.io
---
# TODO: remove this, once https://github.com/rook/rook/issues/10141
# is resolved.
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ceph-nfs-csi-nodeplugin-role
subjects:
- kind: ServiceAccount
name: rook-csi-nfs-plugin-sa
namespace: {{ .Release.Namespace }} # namespace:operator
roleRef:
kind: ClusterRole
name: ceph-nfs-csi-nodeplugin
apiGroup: rbac.authorization.k8s.io
---
{{ end }}
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
+30
View File
@@ -2,6 +2,21 @@
# These RBAC resources are required to allow Rook to run the NFS export CSI driver components.
####################################################################################################
---
# TODO: remove this, once https://github.com/rook/rook/issues/10141
# is resolved.
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ceph-nfs-csi-nodeplugin
labels:
operator: rook
storage-backend: ceph
app.kubernetes.io/part-of: rook-ceph-operator
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get"]
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
@@ -32,6 +47,21 @@ rules:
resources: ["secrets"]
verbs: ["get"]
---
# TODO: remove this, once https://github.com/rook/rook/issues/10141
# is resolved.
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ceph-nfs-csi-nodeplugin-role
subjects:
- kind: ServiceAccount
name: rook-csi-nfs-plugin-sa
namespace: rook-ceph # namespace:operator
roleRef:
kind: ClusterRole
name: ceph-nfs-csi-nodeplugin
apiGroup: rbac.authorization.k8s.io
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
+3
View File
@@ -191,6 +191,9 @@ function hack_csv() {
$SED_IN_PLACE 's/cephfs-csi-nodeplugin/rook-csi-cephfs-plugin-sa/' "$CSV_FILE_NAME"
$SED_IN_PLACE 's/cephfs-external-provisioner-runner/rook-csi-cephfs-provisioner-sa/' "$CSV_FILE_NAME"
$SED_IN_PLACE 's/ceph-nfs-csi-nodeplugin/rook-csi-nfs-plugin-sa/' "$CSV_FILE_NAME"
$SED_IN_PLACE 's/ceph-nfs-external-provisioner-runner/rook-csi-nfs-provisioner-sa/' "$CSV_FILE_NAME"
$SED_IN_PLACE 's/rbd-csi-nodeplugin/rook-csi-rbd-plugin-sa/' "$CSV_FILE_NAME"
$SED_IN_PLACE 's/rbd-external-provisioner-runner/rook-csi-rbd-provisioner-sa/' "$CSV_FILE_NAME"
# The operator-sdk also does not properly respect when