[bitnami/common] Fix VPA apiVersion (#30625)

This commit is contained in:
Juan Ariza Toledano
2024-11-26 13:24:39 +01:00
committed by GitHub
parent 0e5573b5dc
commit 8c24438a2f
3 changed files with 14 additions and 10 deletions

View File

@@ -157,14 +157,12 @@ Return the appropriate apiVersion for Vertical Pod Autoscaler.
*/}}
{{- define "common.capabilities.vpa.apiVersion" -}}
{{- $kubeVersion := include "common.capabilities.kubeVersion" .context -}}
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.23-0" $kubeVersion) -}}
{{- if .beta2 -}}
{{- print "autoscaling/v2beta2" -}}
{{- if and (not (empty $kubeVersion)) (semverCompare "<1.11-0" $kubeVersion) -}}
{{- print "autoscaling/v1beta1" -}}
{{- else if and (not (empty $kubeVersion)) (semverCompare "<1.25-0" $kubeVersion) -}}
{{- print "autoscaling/v1beta2" -}}
{{- else -}}
{{- print "autoscaling/v2beta1" -}}
{{- end -}}
{{- else -}}
{{- print "autoscaling/v2" -}}
{{- print "autoscaling/v1" -}}
{{- end -}}
{{- end -}}