improved checking for APIversion Capabilities

This commit is contained in:
felix 2023-09-05 09:37:31 +00:00
parent e678d92f71
commit 276eb22c0a
No known key found for this signature in database

View file

@ -1,5 +1,5 @@
{{- if .Values.autoscaling.enabled }} {{- if .Values.autoscaling.enabled }}
{{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion -}} {{- if .Capabilities.APIVersions.Has "autoscaling/v2" -}}
apiVersion: autoscaling/v2 apiVersion: autoscaling/v2
{{- else -}} {{- else -}}
apiVersion: autoscaling/v2beta1 apiVersion: autoscaling/v2beta1