From 605469c603cf44f3599f8ef493c8723394d1b440 Mon Sep 17 00:00:00 2001 From: vardhaman Date: Tue, 20 Dec 2022 08:56:22 +0530 Subject: [PATCH] psp related fixes for rancher-sachet chart --- .../rancher-alerting/rancher-sachet/charts/templates/psp.yaml | 2 ++ .../rancher-alerting/rancher-sachet/charts/templates/role.yaml | 2 ++ .../rancher-sachet/charts/templates/rolebinding.yaml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/packages/rancher-alerting/rancher-sachet/charts/templates/psp.yaml b/packages/rancher-alerting/rancher-sachet/charts/templates/psp.yaml index 3469d3fcc..a474a0d32 100644 --- a/packages/rancher-alerting/rancher-sachet/charts/templates/psp.yaml +++ b/packages/rancher-alerting/rancher-sachet/charts/templates/psp.yaml @@ -1,3 +1,4 @@ +{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy" }} apiVersion: policy/v1beta1 kind: PodSecurityPolicy metadata: @@ -27,3 +28,4 @@ spec: volumes: - 'configMap' - 'secret' +{{- end }} diff --git a/packages/rancher-alerting/rancher-sachet/charts/templates/role.yaml b/packages/rancher-alerting/rancher-sachet/charts/templates/role.yaml index 05d4410e3..4b4296cf4 100644 --- a/packages/rancher-alerting/rancher-sachet/charts/templates/role.yaml +++ b/packages/rancher-alerting/rancher-sachet/charts/templates/role.yaml @@ -1,3 +1,4 @@ +{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy" }} apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: @@ -13,3 +14,4 @@ rules: - podsecuritypolicies verbs: - use +{{- end }} diff --git a/packages/rancher-alerting/rancher-sachet/charts/templates/rolebinding.yaml b/packages/rancher-alerting/rancher-sachet/charts/templates/rolebinding.yaml index 174f0d9e8..000d7e7bd 100644 --- a/packages/rancher-alerting/rancher-sachet/charts/templates/rolebinding.yaml +++ b/packages/rancher-alerting/rancher-sachet/charts/templates/rolebinding.yaml @@ -1,3 +1,4 @@ +{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy" }} apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -11,3 +12,4 @@ roleRef: subjects: - kind: ServiceAccount name: {{ include "sachet.fullname" . }} +{{- end }}