From 4da2355fa9087031c95112376963994c8f31b9ba Mon Sep 17 00:00:00 2001 From: Asher Foa Date: Mon, 16 Dec 2024 12:18:20 -0500 Subject: [PATCH] Fix broken reference name to controller name when setting controller.containerName Follow up for https://github.com/aws/karpenter-provider-aws/pull/7384 --- charts/karpenter/templates/_helpers.tpl | 8 ++++++++ charts/karpenter/templates/deployment.yaml | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/charts/karpenter/templates/_helpers.tpl b/charts/karpenter/templates/_helpers.tpl index 212f599b12dc..85ae07283344 100644 --- a/charts/karpenter/templates/_helpers.tpl +++ b/charts/karpenter/templates/_helpers.tpl @@ -45,6 +45,14 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} {{- end }} + +{{/* +Container name +*/}} +{{- define "karpenter.controller.ContainerName" -}} +{{ .Values.controller.containerName | default "controller" }} +{{- end }} + {{/* Selector labels */}} diff --git a/charts/karpenter/templates/deployment.yaml b/charts/karpenter/templates/deployment.yaml index 990ce486292e..a36edab14bea 100644 --- a/charts/karpenter/templates/deployment.yaml +++ b/charts/karpenter/templates/deployment.yaml @@ -60,7 +60,7 @@ spec: schedulerName: {{ . | quote }} {{- end }} containers: - - name: {{ .Values.controller.containerName | default "controller" }} + - name: {{ include "karpenter.controller.ContainerName" . }} securityContext: runAsUser: 65532 runAsGroup: 65532 @@ -102,7 +102,7 @@ spec: - name: MEMORY_LIMIT valueFrom: resourceFieldRef: - containerName: controller + containerName: {{ include "karpenter.controller.ContainerName" . }} divisor: "0" resource: limits.memory - name: FEATURE_GATES