From ad69f02f8f5a23f2ea540a02e4e33d6af0c6a332 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Wed, 15 Jan 2025 21:13:30 +0100 Subject: [PATCH] fix(deployment): set resourceFieldRef.divisor --- templates/prometheus-postgres-exporter/_deployment.tpl | 2 +- unittests/deployment/deployment.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/prometheus-postgres-exporter/_deployment.tpl b/templates/prometheus-postgres-exporter/_deployment.tpl index 57d5935..c5afe20 100644 --- a/templates/prometheus-postgres-exporter/_deployment.tpl +++ b/templates/prometheus-postgres-exporter/_deployment.tpl @@ -14,7 +14,7 @@ {{- define "prometheus-postgres-exporter.deployment.env" -}} {{- $env := dict "env" (.Values.deployment.postgresExporter.env | default (list) ) }} {{- if and (hasKey .Values.deployment.postgresExporter.resources "limits") (hasKey .Values.deployment.postgresExporter.resources.limits "cpu") }} -{{- $env = merge $env (dict "env" (list (dict "name" "GOMAXPROCS" "valueFrom" (dict "resourceFieldRef" (dict "resource" "limits.cpu"))))) }} +{{- $env = merge $env (dict "env" (list (dict "name" "GOMAXPROCS" "valueFrom" (dict "resourceFieldRef" (dict "divisor" "1" "resource" "limits.cpu"))))) }} {{- end }} {{ toYaml $env }} {{- end -}} diff --git a/unittests/deployment/deployment.yaml b/unittests/deployment/deployment.yaml index aead8fa..e92dfd1 100644 --- a/unittests/deployment/deployment.yaml +++ b/unittests/deployment/deployment.yaml @@ -233,6 +233,7 @@ tests: - name: GOMAXPROCS valueFrom: resourceFieldRef: + divisor: "1" resource: limits.cpu - equal: path: spec.template.spec.containers[0].resources