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