Skip to content

Commit

Permalink
Fix missing envs key when .Values.env is not set but .Values.envs.sec…
Browse files Browse the repository at this point in the history
…retMappings is
  • Loading branch information
chrbrnracn committed Sep 26, 2024
1 parent 16831e5 commit d3af164
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/kafka-ui/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 8 additions & 5 deletions charts/kafka-ui/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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:
Expand Down

0 comments on commit d3af164

Please sign in to comment.