helm: Fix PDB apiVersion to allow K8s 1.25+ deployment (#13783)

This commit is contained in:
Jason Witkowski 2023-02-15 00:54:01 -05:00 committed by GitHub
parent 9ffaba9c7f
commit 355cdbeb86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 3 deletions

View File

@ -30,7 +30,7 @@ dependencies:
version: 8.6.4
repository: https://charts.helm.sh/stable
condition: postgresql.enabled
version: 0.3.3
version: 0.3.4
home: https://druid.apache.org/
icon: https://druid.apache.org/img/favicon.png
sources:

View File

@ -0,0 +1,17 @@
{{/*
Return the target Kubernetes version
*/}}
{{- define "capabilities.kubeVersion" -}}
{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
{{- end -}}
{{/*
Return the appropriate apiVersion for poddisruptionbudget.
*/}}
{{- define "capabilities.policy.apiVersion" -}}
{{- if semverCompare "<1.21-0" (include "capabilities.kubeVersion" .) -}}
{{- print "policy/v1beta1" -}}
{{- else -}}
{{- print "policy/v1" -}}
{{- end -}}
{{- end -}}

View File

@ -18,7 +18,7 @@
*/}}
{{- if .Values.historical.podDisruptionBudget.enabled }}
apiVersion: policy/v1beta1
apiVersion: {{ include "capabilities.policy.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
labels:

View File

@ -18,7 +18,7 @@
*/}}
{{- if .Values.middleManager.podDisruptionBudget.enabled }}
apiVersion: policy/v1beta1
apiVersion: {{ include "capabilities.policy.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
labels: