Skip to content

Commit

Permalink
helm chart: fix the upgrade of the PodDisruptionBudget's apiVersion
Browse files Browse the repository at this point in the history
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: <https://helm.sh/docs/topics/kubernetes_apis/#helm-users>

Closes open-policy-agent#184

Signed-off-by: elchenberg <[email protected]>
  • Loading branch information
elchenberg committed Feb 15, 2023
1 parent fb3e8a5 commit 3596551
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions charts/opa-kube-mgmt/templates/poddisruptionbudget.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 3596551

Please sign in to comment.