From 35965511b96f8c8efeed8f2b1235cf5f2e725dcd Mon Sep 17 00:00:00 2001 From: elchenberg Date: Wed, 15 Feb 2023 09:30:37 +0100 Subject: [PATCH] helm chart: fix the upgrade of the PodDisruptionBudget's apiVersion Previously the chart used the deprecated apiVersion policy/v1beta1 as long as it was avaiable in the cluster. This is against the recommendation of upgrading the release to a supported apiVersion prior to upgrading the cluster to a version that removes the deprecated apiVersion: Closes #184 Signed-off-by: elchenberg --- charts/opa-kube-mgmt/templates/poddisruptionbudget.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/opa-kube-mgmt/templates/poddisruptionbudget.yaml b/charts/opa-kube-mgmt/templates/poddisruptionbudget.yaml index c6d039bf..fc0f07de 100644 --- a/charts/opa-kube-mgmt/templates/poddisruptionbudget.yaml +++ b/charts/opa-kube-mgmt/templates/poddisruptionbudget.yaml @@ -1,8 +1,8 @@ {{- if .Values.podDisruptionBudget.enabled }} -{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodDisruptionBudget" }} -apiVersion: policy/v1beta1 -{{- else }} +{{- if .Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" }} apiVersion: policy/v1 +{{- else }} +apiVersion: policy/v1beta1 {{- end }} kind: PodDisruptionBudget metadata: