badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 1 | {{/* |
| 2 | # Copyright 2020-present Open Networking Foundation |
| 3 | |
| 4 | # SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
| 5 | */}} |
| 6 | |
| 7 | {{- if .Values.config.webui.deploy }} |
| 8 | |
| 9 | {{- if not .Values.config.useExistingConfigMap -}} |
| 10 | {{- $webuicfg := index .Values.config.webui.cfgFiles "webuicfg.conf" }} |
| 11 | {{- $config := index $webuicfg "configuration" }} |
| 12 | |
| 13 | {{- if not (hasKey $webuicfg "logger") -}} |
| 14 | {{- $_ := .Values.config.logger | set $webuicfg "logger" -}} |
| 15 | {{- end }} |
| 16 | |
| 17 | {{- if not (hasKey $config "managedByConfigPod") -}} |
| 18 | {{- $_ := .Values.config.managedByConfigPod | set $config "managedByConfigPod" -}} |
| 19 | {{- end }} |
| 20 | |
| 21 | {{- if not (hasKey $config "mongodb") -}} |
| 22 | {{- $_ := dict "name" .Values.config.mongodb.name "url" .Values.config.mongodb.url | set $config "mongodb" -}} |
| 23 | {{- end }} |
| 24 | |
| 25 | {{- end }} |
| 26 | |
| 27 | --- |
| 28 | apiVersion: v1 |
| 29 | kind: ConfigMap |
| 30 | metadata: |
| 31 | name: webui |
| 32 | labels: |
| 33 | {{ tuple "webui" . | include "5g-control-plane.metadata_labels" | indent 4 }} |
| 34 | data: |
| 35 | webui-run.sh: | |
| 36 | {{ tuple "bin/_webui-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }} |
| 37 | {{- if not .Values.config.useExistingConfigMap -}} |
| 38 | {{- range $key, $value := .Values.config.webui.cfgFiles }} |
| 39 | {{ $key }}: |- |
| 40 | {{ toYaml $value | indent 4 }} |
| 41 | {{- end }} |
| 42 | {{- end }} |
| 43 | {{- end }} |