From bb9b3a1998486b6da4ba28d0fcab728b1ca66530 Mon Sep 17 00:00:00 2001 From: Shinya Hayashi Date: Tue, 25 Jan 2022 06:41:33 +0000 Subject: [PATCH] helm: fix csiAddons enabled flag We should use csiAddons.enabled to check whether csiAddons is used. Signed-off-by: Shinya Hayashi (cherry picked from commit c82099c107f4ae2a4c71b03833b325582cde7d45) --- build/rbac/get-helm-rbac.sh | 1 + deploy/charts/rook-ceph/templates/role.yaml | 4 ++-- deploy/charts/rook-ceph/templates/rolebinding.yaml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build/rbac/get-helm-rbac.sh b/build/rbac/get-helm-rbac.sh index 98e6b62be..b1b0fec1f 100755 --- a/build/rbac/get-helm-rbac.sh +++ b/build/rbac/get-helm-rbac.sh @@ -13,6 +13,7 @@ pushd "$SCRIPT_DIR" &>/dev/stderr options=( --namespace rook-ceph --set crds.enabled=false + --set csi.csiAddons.enabled=true ) if [[ -z "${DO_NOT_INCLUDE_POD_SECURITY_POLICY_RESOURCES}" ]]; then options+=(--set pspEnable=true) diff --git a/deploy/charts/rook-ceph/templates/role.yaml b/deploy/charts/rook-ceph/templates/role.yaml index 7182e71b1..88872ed76 100644 --- a/deploy/charts/rook-ceph/templates/role.yaml +++ b/deploy/charts/rook-ceph/templates/role.yaml @@ -61,7 +61,7 @@ rules: resources: ["leases"] verbs: ["get", "watch", "list", "delete", "update", "create"] --- -{{- if .Values.csi.csiAddons }} +{{- if and .Values.csi.csiAddons .Values.csi.csiAddons.enabled }} kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: @@ -88,7 +88,7 @@ rules: - apiGroups: ["coordination.k8s.io"] resources: ["leases"] verbs: ["get", "watch", "list", "delete", "update", "create"] - {{- if .Values.csi.csiAddons }} + {{- if and .Values.csi.csiAddons .Values.csi.csiAddons.enabled }} - apiGroups: ["csiaddons.openshift.io"] resources: ["csiaddonsnodes"] verbs: ["create"] diff --git a/deploy/charts/rook-ceph/templates/rolebinding.yaml b/deploy/charts/rook-ceph/templates/rolebinding.yaml index 5e5c4e6ce..619b00fd0 100644 --- a/deploy/charts/rook-ceph/templates/rolebinding.yaml +++ b/deploy/charts/rook-ceph/templates/rolebinding.yaml @@ -32,7 +32,7 @@ roleRef: name: cephfs-external-provisioner-cfg apiGroup: rbac.authorization.k8s.io --- -{{- if .Values.csi.csiAddons }} +{{- if and .Values.csi.csiAddons .Values.csi.csiAddons.enabled }} kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: