Remove faulty .Capabilities check for node-exporter

pull/2410/head
Arvind Iyengar 2023-02-10 15:30:31 -08:00
parent dd63ae66f4
commit 6bde4c49aa
No known key found for this signature in database
GPG Key ID: A8DD9BFD6C811498
1 changed files with 1 additions and 15 deletions

View File

@ -1,23 +1,9 @@
--- charts-original/templates/psp-clusterrole.yaml
+++ charts/templates/psp-clusterrole.yaml
@@ -1,15 +1,17 @@
@@ -1,5 +1,5 @@
{{- if .Values.rbac.create }}
-{{- if .Values.rbac.pspEnabled }}
+{{- if .Values.global.cattle.psp.enabled }}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: psp-{{ template "prometheus-node-exporter.fullname" . }}
labels: {{ include "prometheus-node-exporter.labels" . | indent 4 }}
rules:
+{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicies" }}
- apiGroups: ['extensions']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
- {{ template "prometheus-node-exporter.fullname" . }}
+{{- end }}
{{- end }}
-{{- end }}
+{{- end }}
\ No newline at end of file