From 67f7d3da63ba723c2d5f8f2d1dacd40a72a248c2 Mon Sep 17 00:00:00 2001 From: Wilmar den Ouden Date: Sat, 24 Sep 2022 13:38:05 +0200 Subject: [PATCH] fix: do not apply job-patch psp on Kubernetes 1.25 and newer (#9074) * fix: do not apply job-patch psp on Kubernetes 1.25 and newer Signed-off-by: wilmarguida * fix: bump kubernetes version for helm chart CI to 1.25.0 Signed-off-by: wilmarguida Signed-off-by: wilmarguida --- .github/workflows/ci.yaml | 2 +- .../templates/admission-webhooks/job-patch/psp.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9d7941ab5..fc106b495 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -175,7 +175,7 @@ jobs: uses: engineerd/setup-kind@aa272fe2a7309878ffc2a81c56cfe3ef108ae7d0 #v0.5.0 with: version: v0.15.0 - image: kindest/node:v1.24.4 + image: kindest/node:v1.25.0 - uses: geekyeggo/delete-artifact@b73cb986740e466292a536d0e32e2666c56fdeb3 # v1 with: diff --git a/charts/ingress-nginx/templates/admission-webhooks/job-patch/psp.yaml b/charts/ingress-nginx/templates/admission-webhooks/job-patch/psp.yaml index 70edde334..e19c95572 100644 --- a/charts/ingress-nginx/templates/admission-webhooks/job-patch/psp.yaml +++ b/charts/ingress-nginx/templates/admission-webhooks/job-patch/psp.yaml @@ -1,3 +1,4 @@ +{{- if (semverCompare "<1.25.0-0" .Capabilities.KubeVersion.Version) }} {{- if and .Values.controller.admissionWebhooks.enabled .Values.controller.admissionWebhooks.patch.enabled .Values.podSecurityPolicy.enabled (empty .Values.controller.admissionWebhooks.existingPsp) -}} apiVersion: policy/v1beta1 kind: PodSecurityPolicy @@ -37,3 +38,4 @@ spec: - secret - downwardAPI {{- end }} +{{- end }}