diff --git a/charts/argo-workflows/Chart.yaml b/charts/argo-workflows/Chart.yaml index abaa5811..bb73226f 100644 --- a/charts/argo-workflows/Chart.yaml +++ b/charts/argo-workflows/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: argo-workflows description: A Helm chart for Argo Workflows type: application -version: 0.15.2 +version: 0.15.3 appVersion: v3.3.5 icon: https://raw.githubusercontent.com/argoproj/argo-workflows/master/docs/assets/argo.png home: https://github.com/argoproj/argo-helm @@ -15,4 +15,4 @@ maintainers: - name: benjaminws annotations: artifacthub.io/changes: | - - "[Changed]: Update to app version v3.3.5" + - "[Fixed]: Adjust api version of pod disruption budget by referring to k8s version" diff --git a/charts/argo-workflows/templates/_helpers.tpl b/charts/argo-workflows/templates/_helpers.tpl index 18eae994..2289951d 100644 --- a/charts/argo-workflows/templates/_helpers.tpl +++ b/charts/argo-workflows/templates/_helpers.tpl @@ -103,6 +103,17 @@ Return the appropriate apiVersion for ingress {{- end -}} {{- end -}} +{{/* +Return the appropriate apiVersion for pod disruption budget +*/}} +{{- define "argo-workflows.podDisruptionBudget.apiVersion" -}} +{{- if semverCompare "<1.21-0" (include "argo-workflows.kubeVersion" $) -}} +{{- print "policy/v1beta1" -}} +{{- else -}} +{{- print "policy/v1" -}} +{{- end -}} +{{- end -}} + {{/* Return the target Kubernetes version */}} diff --git a/charts/argo-workflows/templates/controller/workflow-controller-deployment-pdb.yaml b/charts/argo-workflows/templates/controller/workflow-controller-deployment-pdb.yaml index 564ba412..deef3de1 100644 --- a/charts/argo-workflows/templates/controller/workflow-controller-deployment-pdb.yaml +++ b/charts/argo-workflows/templates/controller/workflow-controller-deployment-pdb.yaml @@ -1,5 +1,5 @@ {{- if .Values.controller.pdb.enabled }} -apiVersion: policy/v1beta1 +apiVersion: {{ include "argo-workflows.podDisruptionBudget.apiVersion" . }} kind: PodDisruptionBudget metadata: name: {{ template "argo-workflows.controller.fullname" . }} diff --git a/charts/argo-workflows/templates/server/server-deployment-pdb.yaml b/charts/argo-workflows/templates/server/server-deployment-pdb.yaml index aeba6547..47be0dd1 100644 --- a/charts/argo-workflows/templates/server/server-deployment-pdb.yaml +++ b/charts/argo-workflows/templates/server/server-deployment-pdb.yaml @@ -1,5 +1,5 @@ {{- if and .Values.server.enabled .Values.server.pdb.enabled -}} -apiVersion: policy/v1beta1 +apiVersion: {{ include "argo-workflows.podDisruptionBudget.apiVersion" . }} kind: PodDisruptionBudget metadata: name: {{ template "argo-workflows.server.fullname" . }}