From e06d6a8fc88cb0c96052379856d4a1c64e3c5eeb Mon Sep 17 00:00:00 2001 From: Viktor Collin Date: Mon, 13 Feb 2023 21:58:03 +0100 Subject: [PATCH] fix: issue with apiVersion not being set for psp make sure to use `apiVersion: policy/v1beta1` for PodSecurityPolicy when kubernetes version is above 1.10. This fix will work (with a deprecation warning) for cluster version below 1.25 when psp is removed. --- charts/cluster-autoscaler/Chart.yaml | 2 +- charts/cluster-autoscaler/templates/_helpers.tpl | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/charts/cluster-autoscaler/Chart.yaml b/charts/cluster-autoscaler/Chart.yaml index 14370e658e1e..c2b962cce174 100644 --- a/charts/cluster-autoscaler/Chart.yaml +++ b/charts/cluster-autoscaler/Chart.yaml @@ -11,4 +11,4 @@ name: cluster-autoscaler sources: - https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler type: application -version: 9.23.1 +version: 9.23.2 diff --git a/charts/cluster-autoscaler/templates/_helpers.tpl b/charts/cluster-autoscaler/templates/_helpers.tpl index 25d1eb8245f7..944fd1cf6f24 100644 --- a/charts/cluster-autoscaler/templates/_helpers.tpl +++ b/charts/cluster-autoscaler/templates/_helpers.tpl @@ -70,8 +70,6 @@ Return the appropriate apiVersion for podsecuritypolicy. {{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }} {{- if semverCompare "<1.10-0" $kubeTargetVersion -}} {{- print "extensions/v1beta1" -}} -{{- else if semverCompare ">1.21-0" $kubeTargetVersion -}} -{{- print "policy/v1" -}} {{- else -}} {{- print "policy/v1beta1" -}} {{- end -}}