From ca676fcf6f1acbf311a5d4babab781ca3ff73578 Mon Sep 17 00:00:00 2001 From: Arvind Iyengar Date: Fri, 27 Jan 2023 17:07:05 -0800 Subject: [PATCH] [rancher-monitoring-crd] Use global.cattle.psp.enabled field --- .../templates/crd-template/templates/rbac.yaml | 4 ++-- .../rancher-monitoring/templates/crd-template/values.yaml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/rancher-monitoring/rancher-monitoring/templates/crd-template/templates/rbac.yaml b/packages/rancher-monitoring/rancher-monitoring/templates/crd-template/templates/rbac.yaml index cb3c9224a..b063d283a 100644 --- a/packages/rancher-monitoring/rancher-monitoring/templates/crd-template/templates/rbac.yaml +++ b/packages/rancher-monitoring/rancher-monitoring/templates/crd-template/templates/rbac.yaml @@ -10,7 +10,7 @@ rules: resources: - customresourcedefinitions verbs: ['create', 'get', 'patch', 'delete'] -{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy" }} +{{- if .Values.global.cattle.psp.enabled }} - apiGroups: ['policy'] resources: ['podsecuritypolicies'] verbs: ['use'] @@ -41,7 +41,7 @@ metadata: labels: app: {{ .Chart.Name }}-manager --- -{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy" }} +{{- if .Values.global.cattle.psp.enabled }} apiVersion: policy/v1beta1 kind: PodSecurityPolicy metadata: diff --git a/packages/rancher-monitoring/rancher-monitoring/templates/crd-template/values.yaml b/packages/rancher-monitoring/rancher-monitoring/templates/crd-template/values.yaml index 387d8a036..8963ac34a 100644 --- a/packages/rancher-monitoring/rancher-monitoring/templates/crd-template/values.yaml +++ b/packages/rancher-monitoring/rancher-monitoring/templates/crd-template/values.yaml @@ -4,6 +4,8 @@ global: cattle: + psp: + enabled: false systemDefaultRegistry: "" image: