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.nrf.deploy }} |
| 8 | |
| 9 | {{- if not .Values.config.useExistingConfigMap -}} |
| 10 | {{- $nrfcfg := index .Values.config.nrf.cfgFiles "nrfcfg.conf" }} |
| 11 | {{- $config := index $nrfcfg "configuration" }} |
| 12 | {{- $sbi := index $config "sbi" }} |
| 13 | |
| 14 | {{- if not (hasKey $config "MongoDBName") -}} |
| 15 | {{- $_ := .Values.config.mongodb.name | set $config "MongoDBName" -}} |
| 16 | {{- end }} |
| 17 | |
| 18 | {{- if not (hasKey $config "MongoDBUrl") -}} |
| 19 | {{- $_ := .Values.config.mongodb.url | set $config "MongoDBUrl" -}} |
| 20 | {{- end }} |
| 21 | |
| 22 | {{- if not (hasKey $nrfcfg "logger") -}} |
| 23 | {{- $_ := .Values.config.logger | set $nrfcfg "logger" -}} |
| 24 | {{- end }} |
| 25 | |
| 26 | {{- if not (hasKey $sbi "port") -}} |
| 27 | {{- $_ := .Values.config.nrf.sbi.port | set $sbi "port" -}} |
| 28 | {{- end }} |
| 29 | {{- end }} |
| 30 | |
| 31 | --- |
| 32 | apiVersion: v1 |
| 33 | kind: ConfigMap |
| 34 | metadata: |
| 35 | name: nrf |
| 36 | labels: |
| 37 | {{ tuple "nrf" . | include "5g-control-plane.metadata_labels" | indent 4 }} |
| 38 | data: |
| 39 | nrf-run.sh: | |
| 40 | {{ tuple "bin/_nrf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }} |
| 41 | {{- if not .Values.config.useExistingConfigMap -}} |
| 42 | {{- range $key, $value := .Values.config.nrf.cfgFiles }} |
| 43 | {{ $key }}: |- |
| 44 | {{ toYaml $value | indent 4 }} |
| 45 | {{- end }} |
| 46 | {{- end }} |
| 47 | {{- end }} |