From 306cf5aa9cdcaf4f9712db93445bff42474007f3 Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Mon, 17 Jul 2023 15:10:49 -0700 Subject: [PATCH] Check if API is available in Helm Chart (#4070) Checks if autoscaling/v2 is available rather than checking a specific version of kubernetes --- deployments/helm-chart/templates/controller-hpa.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/helm-chart/templates/controller-hpa.yaml b/deployments/helm-chart/templates/controller-hpa.yaml index bc71463900..b8691648e9 100644 --- a/deployments/helm-chart/templates/controller-hpa.yaml +++ b/deployments/helm-chart/templates/controller-hpa.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.controller.autoscaling.enabled (eq .Values.controller.kind "deployment") (semverCompare ">=1.23.0" .Capabilities.KubeVersion.Version) -}} +{{- if and .Values.controller.autoscaling.enabled (eq .Values.controller.kind "deployment") (.Capabilities.APIVersions.Has "autoscaling/v2") -}} apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: