Skip to content

Commit

Permalink
Merge pull request #117 from Noamshmueli/bugfix/hpa-version
Browse files Browse the repository at this point in the history
fix HPA api version
  • Loading branch information
pmint93 authored Jun 12, 2024
2 parents d34d68c + 9d421e4 commit c19994c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/metabase/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description:
The easy, open source way for everyone in your company to ask questions
and learn from data.
name: metabase
version: 2.15.7
version: 2.15.8
appVersion: v0.49.13
maintainers:
- name: pmint93
Expand Down
11 changes: 11 additions & 0 deletions charts/metabase/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ Return the apiVersion of deployment.
{{- end -}}
{{- end -}}

{{/*
Return the apiVersion of hpa.
*/}}
{{- define "hpa.apiVersion" -}}
{{- if semverCompare "<1.23-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "autoscaling/v1" -}}
{{- else if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "autoscaling/v2" -}}
{{- end -}}
{{- end -}}

{{/*
Create the name of the service account to use
*/}}
Expand Down
2 changes: 1 addition & 1 deletion charts/metabase/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.hpa.enabled }}
apiVersion: autoscaling/v2beta2
apiVersion: {{ template "hpa.apiVersion" . }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "metabase.fullname" . }}
Expand Down

0 comments on commit c19994c

Please sign in to comment.