From 87176e13548cca74aa96e08b4ec35d177a3c7e67 Mon Sep 17 00:00:00 2001 From: Scott McCullough Date: Mon, 10 Jul 2023 17:06:13 -0400 Subject: [PATCH] fix(charts/dex): Templating error caused by #111 (#114) Signed-off-by: GitHub Signed-off-by: Maksim Nabokikh Co-authored-by: Maksim Nabokikh --- charts/dex/Chart.yaml | 6 +++--- charts/dex/README.md | 2 +- charts/dex/templates/hpa.yaml | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/charts/dex/Chart.yaml b/charts/dex/Chart.yaml index 1e8a3af8..e894eee5 100644 --- a/charts/dex/Chart.yaml +++ b/charts/dex/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 type: application name: dex -version: 0.15.1 +version: 0.15.2 appVersion: "2.37.0" kubeVersion: ">=1.14.0-0" description: OpenID Connect (OIDC) identity and OAuth 2.0 provider with pluggable connectors. @@ -21,8 +21,8 @@ maintainers: url: https://sagikazarmark.hu annotations: artifacthub.io/changes: | - - kind: added - description: "Add spec.revisionHistoryLimit config possibility for Deployment resource" + - kind: fixed + description: "Fixed error stemming from the formatting of the new autoscaling API version" artifacthub.io/images: | - name: dex image: ghcr.io/dexidp/dex:v2.37.0 diff --git a/charts/dex/README.md b/charts/dex/README.md index 2cf5b16e..4a74c87a 100644 --- a/charts/dex/README.md +++ b/charts/dex/README.md @@ -1,6 +1,6 @@ # dex -![version: 0.15.1](https://img.shields.io/badge/version-0.15.1-informational?style=flat-square) ![type: application](https://img.shields.io/badge/type-application-informational?style=flat-square) ![app version: 2.37.0](https://img.shields.io/badge/app%20version-2.37.0-informational?style=flat-square) ![kube version: >=1.14.0-0](https://img.shields.io/badge/kube%20version->=1.14.0--0-informational?style=flat-square) [![artifact hub](https://img.shields.io/badge/artifact%20hub-dex-informational?style=flat-square)](https://artifacthub.io/packages/helm/dex/dex) +![version: 0.15.2](https://img.shields.io/badge/version-0.15.2-informational?style=flat-square) ![type: application](https://img.shields.io/badge/type-application-informational?style=flat-square) ![app version: 2.37.0](https://img.shields.io/badge/app%20version-2.37.0-informational?style=flat-square) ![kube version: >=1.14.0-0](https://img.shields.io/badge/kube%20version->=1.14.0--0-informational?style=flat-square) [![artifact hub](https://img.shields.io/badge/artifact%20hub-dex-informational?style=flat-square)](https://artifacthub.io/packages/helm/dex/dex) OpenID Connect (OIDC) identity and OAuth 2.0 provider with pluggable connectors. diff --git a/charts/dex/templates/hpa.yaml b/charts/dex/templates/hpa.yaml index 1b0a7e06..166faea9 100644 --- a/charts/dex/templates/hpa.yaml +++ b/charts/dex/templates/hpa.yaml @@ -18,15 +18,33 @@ spec: maxReplicas: {{ .Values.autoscaling.maxReplicas }} metrics: {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- else }} - type: Resource resource: name: cpu targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} {{- end }} + {{- end }} {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- else }} - type: Resource resource: name: memory targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} {{- end }} + {{- end }} {{- end }}