From 08a56683f8b8a19a8094c61a46311cf32869efb5 Mon Sep 17 00:00:00 2001 From: Jonathan Wiemers Date: Fri, 17 Nov 2023 14:38:27 +0100 Subject: [PATCH] fix: k8s > 1.24 do not support autoscaling/v2beta1 (#427) --- charts/mattermost-enterprise-edition/Chart.yaml | 2 +- .../templates/deployment-mattermost-hpa.yaml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/charts/mattermost-enterprise-edition/Chart.yaml b/charts/mattermost-enterprise-edition/Chart.yaml index 1d1a2e42..f9cbf9e3 100644 --- a/charts/mattermost-enterprise-edition/Chart.yaml +++ b/charts/mattermost-enterprise-edition/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 description: Mattermost Enterprise server with high availitibity. name: mattermost-enterprise-edition type: application -version: 2.6.39 +version: 2.6.40 appVersion: 9.2.2 keywords: - mattermost diff --git a/charts/mattermost-enterprise-edition/templates/deployment-mattermost-hpa.yaml b/charts/mattermost-enterprise-edition/templates/deployment-mattermost-hpa.yaml index 195feae2..1a60f6f2 100644 --- a/charts/mattermost-enterprise-edition/templates/deployment-mattermost-hpa.yaml +++ b/charts/mattermost-enterprise-edition/templates/deployment-mattermost-hpa.yaml @@ -1,5 +1,9 @@ {{- if .Values.mattermostApp.autoscaling.enabled }} +{{- if semverCompare ">= 1.25-0" .Capabilities.KubeVersion.Version }} +apiVersion: autoscaling/v2 +{{ else }} apiVersion: autoscaling/v2beta1 +{{ end }} kind: HorizontalPodAutoscaler metadata: labels: