fix(argo-workflows): adjust api version of pod disruption budget by referring to k8s version (#1288)

Signed-off-by: yu-croco <yuki.kita22@gmail.com>
pull/1289/head^2 argo-workflows-0.15.3
Aikawa 2022-05-22 16:43:12 +09:00 committed by GitHub
parent c314fc112c
commit 0e090ef854
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 4 deletions

View File

@ -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"

View File

@ -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
*/}}

View File

@ -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" . }}

View File

@ -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" . }}