Badhrinath | 987e1d8 | 2020-11-20 13:23:58 -0600 | [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 }} |
Hyunsun Moon | 6a65148 | 2021-02-26 01:46:44 -0800 | [diff] [blame] | 8 | |
Hyunsun Moon | c73636b | 2021-03-24 15:47:08 -0700 | [diff] [blame] | 9 | {{- if not .Values.config.useExistingConfigMap -}} |
Hyunsun Moon | 6a65148 | 2021-02-26 01:46:44 -0800 | [diff] [blame] | 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 }} |
Ajay Lotan Thakur | ef182f4 | 2021-05-25 16:41:19 -0500 | [diff] [blame] | 17 | |
Hyunsun Moon | 6a65148 | 2021-02-26 01:46:44 -0800 | [diff] [blame] | 18 | {{- if not (hasKey $config "MongoDBUrl") -}} |
| 19 | {{- $_ := .Values.config.mongodb.url | set $config "MongoDBUrl" -}} |
| 20 | {{- end }} |
Ajay Lotan Thakur | ef182f4 | 2021-05-25 16:41:19 -0500 | [diff] [blame] | 21 | |
Hyunsun Moon | 6a65148 | 2021-02-26 01:46:44 -0800 | [diff] [blame] | 22 | {{- if not (hasKey $config "DefaultServiceIP") -}} |
| 23 | {{- $_ := "POD_IP" | set $config "DefaultServiceIP" -}} |
| 24 | {{- end }} |
| 25 | |
Ajay Lotan Thakur | ef182f4 | 2021-05-25 16:41:19 -0500 | [diff] [blame] | 26 | {{- if not (hasKey $nrfcfg "logger") -}} |
| 27 | {{- $_ := .Values.config.logger | set $nrfcfg "logger" -}} |
| 28 | {{- end }} |
| 29 | |
Hyunsun Moon | 6a65148 | 2021-02-26 01:46:44 -0800 | [diff] [blame] | 30 | {{- if not (hasKey $sbi "port") -}} |
| 31 | {{- $_ := .Values.config.nrf.sbi.port | set $sbi "port" -}} |
| 32 | {{- end }} |
Hyunsun Moon | c73636b | 2021-03-24 15:47:08 -0700 | [diff] [blame] | 33 | {{- end }} |
Hyunsun Moon | 6a65148 | 2021-02-26 01:46:44 -0800 | [diff] [blame] | 34 | |
Badhrinath | 987e1d8 | 2020-11-20 13:23:58 -0600 | [diff] [blame] | 35 | --- |
| 36 | apiVersion: v1 |
| 37 | kind: ConfigMap |
| 38 | metadata: |
| 39 | name: nrf |
| 40 | labels: |
| 41 | {{ tuple "nrf" . | include "5g-control-plane.metadata_labels" | indent 4 }} |
| 42 | data: |
| 43 | nrf-run.sh: | |
| 44 | {{ tuple "bin/_nrf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }} |
Hyunsun Moon | c73636b | 2021-03-24 15:47:08 -0700 | [diff] [blame] | 45 | {{- if not .Values.config.useExistingConfigMap -}} |
Hyunsun Moon | 6a65148 | 2021-02-26 01:46:44 -0800 | [diff] [blame] | 46 | {{- range $key, $value := .Values.config.nrf.cfgFiles }} |
Badhrinath | 987e1d8 | 2020-11-20 13:23:58 -0600 | [diff] [blame] | 47 | {{ $key }}: |- |
| 48 | {{ toYaml $value | indent 4 }} |
| 49 | {{- end }} |
| 50 | {{- end }} |
Hyunsun Moon | c73636b | 2021-03-24 15:47:08 -0700 | [diff] [blame] | 51 | {{- end }} |