From d6e01d4f68a1906943f8a255951af0904c0b9978 Mon Sep 17 00:00:00 2001 From: Reed Schalo Date: Thu, 22 Aug 2024 14:50:53 -0700 Subject: [PATCH 1/3] fix: consume values for log paths --- charts/karpenter/templates/deployment.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/charts/karpenter/templates/deployment.yaml b/charts/karpenter/templates/deployment.yaml index 15389c2342ce..83048f603701 100644 --- a/charts/karpenter/templates/deployment.yaml +++ b/charts/karpenter/templates/deployment.yaml @@ -87,6 +87,14 @@ spec: {{- with .Values.logLevel }} - name: LOG_LEVEL value: "{{ . }}" + {{- end }} + {{- with .Values.logOutputPaths }} + - name: LOG_OUTPUT_PATHS + value: "{{ . }}" + {{- end }} + {{- with .Values.logErrorOutputPaths }} + - name: LOG_ERROR_OUTPUT_PATHS + value: "{{ . }}" {{- end }} - name: METRICS_PORT value: "{{ .Values.controller.metrics.port }}" From 5de24603d006bb7908d5d83ba84044aedae955d8 Mon Sep 17 00:00:00 2001 From: Reed Schalo Date: Mon, 26 Aug 2024 14:12:01 -0700 Subject: [PATCH 2/3] fix: consume values for log paths --- charts/karpenter/templates/_helpers.tpl | 16 ++-------------- charts/karpenter/templates/deployment.yaml | 8 ++------ 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/charts/karpenter/templates/_helpers.tpl b/charts/karpenter/templates/_helpers.tpl index 701fab128153..f42a8874e774 100644 --- a/charts/karpenter/templates/_helpers.tpl +++ b/charts/karpenter/templates/_helpers.tpl @@ -145,24 +145,12 @@ This works because Helm treats dictionaries as mutable objects and allows passin Flatten the stdout logging outputs from args provided */}} {{- define "karpenter.outputPathsList" -}} -{{ $paths := list -}} -{{- range .Values.logOutputPaths -}} - {{- if not (has (printf "%s" . | quote) $paths) -}} - {{- $paths = printf "%s" . | quote | append $paths -}} - {{- end -}} -{{- end -}} -{{ $paths | join ", " }} +{{ join "," .Values.logOutputPaths }} {{- end -}} {{/* Flatten the stderr logging outputs from args provided */}} {{- define "karpenter.errorOutputPathsList" -}} -{{ $paths := list -}} -{{- range .Values.logErrorOutputPaths -}} - {{- if not (has (printf "%s" . | quote) $paths) -}} - {{- $paths = printf "%s" . | quote | append $paths -}} - {{- end -}} -{{- end -}} -{{ $paths | join ", " }} +{{ join "," .Values.logErrorOutputPaths }} {{- end -}} diff --git a/charts/karpenter/templates/deployment.yaml b/charts/karpenter/templates/deployment.yaml index 83048f603701..dabf8402c129 100644 --- a/charts/karpenter/templates/deployment.yaml +++ b/charts/karpenter/templates/deployment.yaml @@ -88,14 +88,10 @@ spec: - name: LOG_LEVEL value: "{{ . }}" {{- end }} - {{- with .Values.logOutputPaths }} - name: LOG_OUTPUT_PATHS - value: "{{ . }}" - {{- end }} - {{- with .Values.logErrorOutputPaths }} + value: {{ include "karpenter.outputPathsList" . }} - name: LOG_ERROR_OUTPUT_PATHS - value: "{{ . }}" - {{- end }} + value: {{ include "karpenter.errorOutputPathsList" . }} - name: METRICS_PORT value: "{{ .Values.controller.metrics.port }}" - name: HEALTH_PROBE_PORT From ffc94045838a6e03508533736cd858dfc73b89ae Mon Sep 17 00:00:00 2001 From: Reed Schalo Date: Mon, 26 Aug 2024 14:34:24 -0700 Subject: [PATCH 3/3] respond to pr comments --- charts/karpenter/templates/_helpers.tpl | 14 -------------- charts/karpenter/templates/deployment.yaml | 8 ++++++-- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/charts/karpenter/templates/_helpers.tpl b/charts/karpenter/templates/_helpers.tpl index f42a8874e774..70827dcc0e70 100644 --- a/charts/karpenter/templates/_helpers.tpl +++ b/charts/karpenter/templates/_helpers.tpl @@ -140,17 +140,3 @@ This works because Helm treats dictionaries as mutable objects and allows passin {{- include "karpenter.patchLabelSelector" (merge (dict "_target" $constraint) $) }} {{- end }} {{- end }} - -{{/* -Flatten the stdout logging outputs from args provided -*/}} -{{- define "karpenter.outputPathsList" -}} -{{ join "," .Values.logOutputPaths }} -{{- end -}} - -{{/* -Flatten the stderr logging outputs from args provided -*/}} -{{- define "karpenter.errorOutputPathsList" -}} -{{ join "," .Values.logErrorOutputPaths }} -{{- end -}} diff --git a/charts/karpenter/templates/deployment.yaml b/charts/karpenter/templates/deployment.yaml index dabf8402c129..f6ce7ff5ca39 100644 --- a/charts/karpenter/templates/deployment.yaml +++ b/charts/karpenter/templates/deployment.yaml @@ -88,10 +88,14 @@ spec: - name: LOG_LEVEL value: "{{ . }}" {{- end }} + {{- with .Values.logOutputPaths }} - name: LOG_OUTPUT_PATHS - value: {{ include "karpenter.outputPathsList" . }} + value: "{{ join "," . }}" + {{- end }} + {{- with .Values.logErrorOutputPaths }} - name: LOG_ERROR_OUTPUT_PATHS - value: {{ include "karpenter.errorOutputPathsList" . }} + value: "{{ join "," . }}" + {{- end }} - name: METRICS_PORT value: "{{ .Values.controller.metrics.port }}" - name: HEALTH_PROBE_PORT