Skip to content

Commit

Permalink
Made envVars handle secrets.
Browse files Browse the repository at this point in the history
  • Loading branch information
pantierra committed Dec 5, 2024
1 parent 817ec9d commit 3eece9a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion helm-chart/eoapi/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ kubeVersion: ">=1.23.0-0"
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: "0.5.0"
version: "0.5.1"

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
14 changes: 14 additions & 0 deletions helm-chart/eoapi/templates/services/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,22 @@ metadata:
name: {{ $serviceName }}-envvar-configmap-{{ $.Release.Name }}
data:
{{- range $envKey, $envValue := index $v "settings" "envVars" }}
{{- if (eq (kindOf $envValue) "map") }}
{{- if (index $envValue "valueFrom") }}
{{- if (index $envValue "valueFrom" "secretKeyRef") }}
{{ upper $envKey }}:
valueFrom:
secretKeyRef:
name: {{ index $envValue "valueFrom" "secretKeyRef" "name" }}
key: {{ index $envValue "valueFrom" "secretKeyRef" "key" }}
{{- else }}
{{ upper $envKey }}: "{{ $envValue }}"
{{- end }}
{{- else }}
{{ upper $envKey }}: "{{ $envValue }}"
{{- end }}
{{- end }}
{{- end }}
---
{{/* END: if index $v "enabled" */}}
{{- end }}
Expand Down

0 comments on commit 3eece9a

Please sign in to comment.