diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index b480d0d1..6ee9ba90 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: v2.3.4 description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 4.6.3 +version: 4.6.4 home: https://github.com/argoproj/argo-helm icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png keywords: @@ -21,4 +21,4 @@ dependencies: condition: redis-ha.enabled annotations: artifacthub.io/changes: | - - "[Added]: Add support for external issuers in server Certificate resource" + - "[Fixed]: Adjust api version of pod disruption budget by referring to k8s version" diff --git a/charts/argo-cd/templates/_helpers.tpl b/charts/argo-cd/templates/_helpers.tpl index 5bc4a49c..44af06dd 100644 --- a/charts/argo-cd/templates/_helpers.tpl +++ b/charts/argo-cd/templates/_helpers.tpl @@ -284,3 +284,14 @@ Create the name of the configmap to use key: redis-password {{- end }} {{- end -}} + +{{/* +Return the appropriate apiVersion for pod disruption budget +*/}} +{{- define "argo-cd.podDisruptionBudget.apiVersion" -}} +{{- if semverCompare "<1.21-0" (include "argo-cd.kubeVersion" $) -}} +{{- print "policy/v1beta1" -}} +{{- else -}} +{{- print "policy/v1" -}} +{{- end -}} +{{- end -}} diff --git a/charts/argo-cd/templates/argocd-application-controller/poddisruptionbudget.yaml b/charts/argo-cd/templates/argocd-application-controller/poddisruptionbudget.yaml index f27e1d74..536294f1 100644 --- a/charts/argo-cd/templates/argocd-application-controller/poddisruptionbudget.yaml +++ b/charts/argo-cd/templates/argocd-application-controller/poddisruptionbudget.yaml @@ -1,5 +1,5 @@ {{- if .Values.controller.pdb.enabled }} -apiVersion: policy/v1beta1 +apiVersion: {{ include "argo-cd.podDisruptionBudget.apiVersion" . }} kind: PodDisruptionBudget metadata: name: {{ template "argo-cd.controller.fullname" . }} diff --git a/charts/argo-cd/templates/argocd-repo-server/poddisruptionbudget.yaml b/charts/argo-cd/templates/argocd-repo-server/poddisruptionbudget.yaml index c388c263..d4a4c93a 100644 --- a/charts/argo-cd/templates/argocd-repo-server/poddisruptionbudget.yaml +++ b/charts/argo-cd/templates/argocd-repo-server/poddisruptionbudget.yaml @@ -1,5 +1,5 @@ {{- if .Values.repoServer.pdb.enabled }} -apiVersion: policy/v1beta1 +apiVersion: {{ include "argo-cd.podDisruptionBudget.apiVersion" . }} kind: PodDisruptionBudget metadata: name: {{ template "argo-cd.repoServer.fullname" . }} diff --git a/charts/argo-cd/templates/argocd-server/poddisruptionbudget.yaml b/charts/argo-cd/templates/argocd-server/poddisruptionbudget.yaml index 2342a1c6..29784ce6 100644 --- a/charts/argo-cd/templates/argocd-server/poddisruptionbudget.yaml +++ b/charts/argo-cd/templates/argocd-server/poddisruptionbudget.yaml @@ -1,5 +1,5 @@ {{- if .Values.server.pdb.enabled }} -apiVersion: policy/v1beta1 +apiVersion: {{ include "argo-cd.podDisruptionBudget.apiVersion" . }} kind: PodDisruptionBudget metadata: name: {{ template "argo-cd.server.fullname" . }} diff --git a/charts/argo-cd/templates/dex/poddisruptionbudget.yaml b/charts/argo-cd/templates/dex/poddisruptionbudget.yaml index 93d952fe..7a16d8bf 100644 --- a/charts/argo-cd/templates/dex/poddisruptionbudget.yaml +++ b/charts/argo-cd/templates/dex/poddisruptionbudget.yaml @@ -1,5 +1,5 @@ {{- if .Values.dex.pdb.enabled }} -apiVersion: policy/v1beta1 +apiVersion: {{ include "argo-cd.podDisruptionBudget.apiVersion" . }} kind: PodDisruptionBudget metadata: name: {{ template "argo-cd.dex.fullname" . }} diff --git a/charts/argo-cd/templates/redis/poddisruptionbudget.yaml b/charts/argo-cd/templates/redis/poddisruptionbudget.yaml index 0f19bb9f..4de55b7e 100644 --- a/charts/argo-cd/templates/redis/poddisruptionbudget.yaml +++ b/charts/argo-cd/templates/redis/poddisruptionbudget.yaml @@ -1,5 +1,5 @@ {{- if .Values.redis.pdb.enabled }} -apiVersion: policy/v1beta1 +apiVersion: {{ include "argo-cd.podDisruptionBudget.apiVersion" . }} kind: PodDisruptionBudget metadata: name: {{ template "argo-cd.redis.fullname" . }}