-
Notifications
You must be signed in to change notification settings - Fork 0
/
configmap-data.yaml
45 lines (38 loc) · 1.38 KB
/
configmap-data.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# SPDX-License-Identifier: AGPL-3.0-only
# SPDX-FileCopyrightText: 2023 Univention GmbH
{{ if not .Values.stackDataUms.dataConfigMapName }}
---
{{ include "common.configMap" (dict "top" . "overrides" "stack-data-ums.configMap-data") }}
...
{{ end }}
{{- define "stack-data-ums.configMap-data" }}
{{- /* Simulates one level of recursion
This applies templating to the values of "stackDataContext" and then
injects the result back into "$.top.Values" so that the values can be
used as if Helm would apply templating to the values file.
*/ -}}
{{- $_ := set $.top.Values "stackDataContext" (fromYaml (tpl (toYaml $.top.Values.stackDataContext) $.top)) }}
{{- with .top }}
metadata:
name: '{{ include "common.names.fullname" . }}-data'
data:
{{- range $path, $_ := $.top.Files.Glob "data-files/default/*.yaml" }}
{{ base $path }}: |-
# Source: {{ $path }}
{{ tpl ($.top.Files.Get $path) $.top | indent 4 }}
{{- end }}
{{- if .Values.stackDataUms.loadDevData }}
{{- range $path, $_ := $.top.Files.Glob "data-files/dev/*.yaml" }}
{{ base $path }}: |-
# Source: {{ $path }}
{{ tpl ($.top.Files.Get $path) $.top | indent 4 }}
{{- end }}
{{- end }}
{{- if .Values.stackDataUms.extraDataFiles }}
{{- range $filename, $filecontent := .Values.stackDataUms.extraDataFiles }}
{{ $filename }}: |-
{{ tpl $filecontent $.top | indent 4 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}