badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 1 | {{/* |
| 2 | # Copyright 2020-present Open Networking Foundation |
| 3 | |
Ajay Lotan Thakur | 03189d2 | 2022-02-10 14:06:03 -0600 | [diff] [blame] | 4 | # SPDX-License-Identifier: Apache-2.0 |
badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 5 | */}} |
| 6 | |
| 7 | {{- if .Values.config.smf.deploy }} |
| 8 | |
| 9 | {{- if not .Values.config.useExistingConfigMap -}} |
| 10 | {{- $smfcfg := index .Values.config.smf.cfgFiles "smfcfg.conf" }} |
| 11 | {{- $sbi := index $smfcfg.configuration "sbi" }} |
| 12 | |
Ajay Lotan Thakur | e7d9a25 | 2022-07-07 16:02:07 -0600 | [diff] [blame] | 13 | {{- if not (hasKey $smfcfg "mongodb") -}} |
| 14 | {{- $_ := dict "name" .Values.config.mongodb.name "url" .Values.config.mongodb.url | set $smfcfg "mongodb" -}} |
| 15 | {{- end }} |
| 16 | |
badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 17 | {{- if not (hasKey $smfcfg "logger") -}} |
| 18 | {{- $_ := .Values.config.logger | set $smfcfg "logger" -}} |
| 19 | {{- end }} |
| 20 | {{- if not (hasKey $sbi "port") -}} |
| 21 | {{- $_ := .Values.config.smf.sbi.port | set $sbi "port" -}} |
| 22 | {{- end }} |
Ajay Lotan Thakur | a2e2adb | 2022-06-06 13:46:30 -0600 | [diff] [blame] | 23 | {{- if not (hasKey $smfcfg.configuration "nfKafka") -}} |
| 24 | {{- $_ := .Values.kafka.nfKafka | set $smfcfg.configuration "nfKafka" -}} |
| 25 | {{- $_ := .Values.kafka.deploy | set $smfcfg.configuration.nfKafka "enable" -}} |
| 26 | {{- end }} |
badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 27 | {{- end }} |
| 28 | |
| 29 | --- |
| 30 | apiVersion: v1 |
| 31 | kind: ConfigMap |
| 32 | metadata: |
| 33 | name: smf |
| 34 | labels: |
| 35 | {{ tuple "smf" . | include "5g-control-plane.metadata_labels" | indent 4 }} |
| 36 | data: |
| 37 | smf-run.sh: | |
| 38 | {{ tuple "bin/_smf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }} |
| 39 | {{- if not .Values.config.useExistingConfigMap -}} |
| 40 | {{- range $key, $value := .Values.config.smf.cfgFiles }} |
| 41 | {{ $key }}: |- |
| 42 | {{ toYaml $value | indent 4 }} |
| 43 | {{- end }} |
| 44 | {{- end }} |
| 45 | {{- end }} |