Ajay Lotan Thakur | 9ad7dfe | 2022-07-25 17:26:03 -0600 | [diff] [blame^] | 1 | {{/* |
| 2 | |
| 3 | # SPDX-FileCopyrightText: 2022-present Intel Corporation |
| 4 | |
| 5 | # SPDX-License-Identifier: Apache-2.0 |
| 6 | */}} |
| 7 | |
| 8 | {{- if .Values.config.upfadapter.deploy }} |
| 9 | |
| 10 | {{- if not .Values.config.useExistingConfigMap -}} |
| 11 | {{- $upfadaptercfg := index .Values.config.upfadapter.cfgFiles "config.yaml" }} |
| 12 | |
| 13 | {{- if not (hasKey $upfadaptercfg "mongodb") -}} |
| 14 | {{- $_ := dict "name" .Values.config.mongodb.name "url" .Values.config.mongodb.url | set $upfadaptercfg "mongodb" -}} |
| 15 | {{- end }} |
| 16 | |
| 17 | {{- end }} |
| 18 | |
| 19 | --- |
| 20 | apiVersion: v1 |
| 21 | kind: ConfigMap |
| 22 | metadata: |
| 23 | name: upf-adapter |
| 24 | labels: |
| 25 | {{ tuple "upfadapter" . | include "5g-control-plane.metadata_labels" | indent 4 }} |
| 26 | data: |
| 27 | upf-adapter-run.sh: | |
| 28 | {{ tuple "bin/_upf-adapter-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }} |
| 29 | {{- if not .Values.config.useExistingConfigMap -}} |
| 30 | {{- range $key, $value := .Values.config.upfadapter.cfgFiles }} |
| 31 | {{ $key }}: |- |
| 32 | {{ toYaml $value | indent 4 }} |
| 33 | {{- end }} |
| 34 | {{- end }} |
| 35 | {{- end }} |