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