From fc922c47245cbf1eaf6aba72128a76a2124122e7 Mon Sep 17 00:00:00 2001 From: Mauren Berti Date: Thu, 15 Dec 2022 10:56:00 -0500 Subject: [PATCH] Add condition for applying PSPs in DaemonSets. --- .../overlay/templates/loggings/k3s/daemonset.yaml | 2 +- .../overlay/templates/loggings/rke/daemonset.yaml | 2 +- .../overlay/templates/loggings/rke2/daemonset.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/rancher-logging/generated-changes/overlay/templates/loggings/k3s/daemonset.yaml b/packages/rancher-logging/generated-changes/overlay/templates/loggings/k3s/daemonset.yaml index 5b391d15e..e79cbaa29 100644 --- a/packages/rancher-logging/generated-changes/overlay/templates/loggings/k3s/daemonset.yaml +++ b/packages/rancher-logging/generated-changes/overlay/templates/loggings/k3s/daemonset.yaml @@ -57,7 +57,7 @@ kind: ServiceAccount metadata: name: "{{ .Release.Name }}-k3s-journald-aggregator" namespace: "{{ .Release.Namespace }}" -{{- if .Values.global.psp.enabled }} +{{- if and .Values.global.psp.enabled (.Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy") }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role diff --git a/packages/rancher-logging/generated-changes/overlay/templates/loggings/rke/daemonset.yaml b/packages/rancher-logging/generated-changes/overlay/templates/loggings/rke/daemonset.yaml index fd38fc1e0..0302d8750 100644 --- a/packages/rancher-logging/generated-changes/overlay/templates/loggings/rke/daemonset.yaml +++ b/packages/rancher-logging/generated-changes/overlay/templates/loggings/rke/daemonset.yaml @@ -62,7 +62,7 @@ kind: ServiceAccount metadata: name: "{{ .Release.Name }}-rke-aggregator" namespace: "{{ .Release.Namespace }}" -{{- if .Values.global.psp.enabled }} +{{- if and .Values.global.psp.enabled (.Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy") }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role diff --git a/packages/rancher-logging/generated-changes/overlay/templates/loggings/rke2/daemonset.yaml b/packages/rancher-logging/generated-changes/overlay/templates/loggings/rke2/daemonset.yaml index 23a91f9df..4d1d4f4df 100644 --- a/packages/rancher-logging/generated-changes/overlay/templates/loggings/rke2/daemonset.yaml +++ b/packages/rancher-logging/generated-changes/overlay/templates/loggings/rke2/daemonset.yaml @@ -63,7 +63,7 @@ kind: ServiceAccount metadata: name: "{{ .Release.Name }}-rke2-journald-aggregator" namespace: "{{ .Release.Namespace }}" -{{- if .Values.global.psp.enabled }} +{{- if and .Values.global.psp.enabled (.Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy") }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role