From d3af164c8ecfbc3f249a2caa85c6129a29b41233 Mon Sep 17 00:00:00 2001 From: Christian Boerner Date: Thu, 26 Sep 2024 13:26:01 +0200 Subject: [PATCH] Fix missing envs key when .Values.env is not set but .Values.envs.secretMappings is --- charts/kafka-ui/Chart.yaml | 2 +- charts/kafka-ui/templates/deployment.yaml | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/charts/kafka-ui/Chart.yaml b/charts/kafka-ui/Chart.yaml index 14e7d25..030a8c7 100644 --- a/charts/kafka-ui/Chart.yaml +++ b/charts/kafka-ui/Chart.yaml @@ -2,6 +2,6 @@ apiVersion: v2 name: kafka-ui description: A Helm chart for kafka-UI type: application -version: 1.4.5 +version: 1.4.6 appVersion: v1.0.0 icon: https://raw.githubusercontent.com/kafbat/kafka-ui/main/documentation/images/logo_new.png diff --git a/charts/kafka-ui/templates/deployment.yaml b/charts/kafka-ui/templates/deployment.yaml index b44831a..079e866 100644 --- a/charts/kafka-ui/templates/deployment.yaml +++ b/charts/kafka-ui/templates/deployment.yaml @@ -51,7 +51,10 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: {{ include "kafka-ui.imageName" . }} imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- if or .Values.env .Values.yamlApplicationConfig .Values.yamlApplicationConfigConfigMap .Values.yamlApplicationConfigSecret }} + {{- if or .Values.env + .Values.yamlApplicationConfig .Values.yamlApplicationConfigConfigMap .Values.yamlApplicationConfigSecret + (.Values.envs).secretMappings (.Values.envs).configMappings + }} env: {{- with .Values.env }} {{- toYaml . | nindent 12 }} @@ -66,20 +69,20 @@ spec: value: /kafka-ui/{{ .Values.yamlApplicationConfigSecret.keyName | default "config.yml" }} {{- end }} {{- end }} - {{- end }} - {{- range $key, $value := .Values.envs.secretMappings }} + {{- range $key, $value := .Values.envs.secretMappings }} - name: {{ $key }} valueFrom: secretKeyRef: name: {{ required "Missing required value envs.secretMappings.[].name" $value.name }} key: {{ required "Missing required value envs.secretMappings.[].keyName" $value.keyName }} - {{- end }} - {{- range $key, $value := .Values.envs.configMappings }} + {{- end }} + {{- range $key, $value := .Values.envs.configMappings }} - name: {{ $key }} valueFrom: configMapKeyRef: name: {{ required "Missing required value envs.configMappings.[].name" $value.name }} key: {{ required "Missing required value envs.configMappings.[].keyName" $value.keyName }} + {{- end }} {{- end }} {{- if or .Values.existingConfigMap .Values.envs.config .Values.existingSecret .Values.envs.secret }} envFrom: