fix(deployment): set resourceFieldRef.divisor
All checks were successful
Release / publish-chart (push) Successful in 28s

This commit is contained in:
Markus Pesch 2025-01-15 21:13:30 +01:00
parent 3ea3f94429
commit ad69f02f8f
Signed by: volker.raschek
GPG Key ID: 852BCC170D81A982
2 changed files with 2 additions and 1 deletions

View File

@ -14,7 +14,7 @@
{{- define "prometheus-postgres-exporter.deployment.env" -}} {{- define "prometheus-postgres-exporter.deployment.env" -}}
{{- $env := dict "env" (.Values.deployment.postgresExporter.env | default (list) ) }} {{- $env := dict "env" (.Values.deployment.postgresExporter.env | default (list) ) }}
{{- if and (hasKey .Values.deployment.postgresExporter.resources "limits") (hasKey .Values.deployment.postgresExporter.resources.limits "cpu") }} {{- 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 }} {{- end }}
{{ toYaml $env }} {{ toYaml $env }}
{{- end -}} {{- end -}}

View File

@ -233,6 +233,7 @@ tests:
- name: GOMAXPROCS - name: GOMAXPROCS
valueFrom: valueFrom:
resourceFieldRef: resourceFieldRef:
divisor: "1"
resource: limits.cpu resource: limits.cpu
- equal: - equal:
path: spec.template.spec.containers[0].resources path: spec.template.spec.containers[0].resources