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 | |
| 24 | {{- if not (hasKey $sbi "registerIPv4") -}} |
| 25 | {{- $_ := "POD_IP" | set $sbi "registerIPv4" -}} |
| 26 | {{- end }} |
| 27 | {{- if not (hasKey $sbi "bindingIPv4") -}} |
| 28 | {{- $_ := "POD_IP" | set $sbi "bindingIPv4" -}} |
| 29 | {{- end }} |
| 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 }} |