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