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.amf.deploy }} |
| 8 | |
| 9 | {{- if not .Values.config.useExistingConfigMap -}} |
| 10 | {{- $amfcfg := index .Values.config.amf.cfgFiles "amfcfg.conf" }} |
| 11 | {{- $sbi := index $amfcfg.configuration "sbi" }} |
| 12 | |
| 13 | {{- if not (hasKey $sbi "port") -}} |
| 14 | {{- $_ := .Values.config.amf.sbi.port | set $sbi "port" -}} |
| 15 | {{- end }} |
| 16 | |
Ajay Lotan Thakur | 6de3b78 | 2022-04-14 08:41:12 -0600 | [diff] [blame] | 17 | {{- if not (hasKey $amfcfg.configuration "ngappPort") -}} |
| 18 | {{- $_ := .Values.config.amf.ngapp.port | set $amfcfg.configuration "ngappPort" -}} |
| 19 | {{- end }} |
| 20 | |
| 21 | {{- if not (hasKey $amfcfg.configuration "sctpGrpcPort") -}} |
| 22 | {{- $_ := .Values.config.amf.sctp_grpc.port | set $amfcfg.configuration "sctpGrpcPort" -}} |
| 23 | {{- end }} |
| 24 | |
Ajay Lotan Thakur | e7d9a25 | 2022-07-07 16:02:07 -0600 | [diff] [blame^] | 25 | {{- if not (hasKey $amfcfg "mongodb") -}} |
| 26 | {{- $_ := dict "name" .Values.config.mongodb.name "url" .Values.config.mongodb.url | set $amfcfg "mongodb" -}} |
| 27 | {{- end }} |
| 28 | |
badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 29 | {{- if not (hasKey $amfcfg "logger") -}} |
| 30 | {{- $_ := .Values.config.logger | set $amfcfg "logger" -}} |
| 31 | {{- end }} |
| 32 | |
Ajay Lotan Thakur | 6de3b78 | 2022-04-14 08:41:12 -0600 | [diff] [blame] | 33 | {{- if not (hasKey $amfcfg.configuration "enableSctpLb") -}} |
| 34 | {{- $_ := .Values.config.sctplb.deploy | set $amfcfg.configuration "enableSctpLb" -}} |
| 35 | {{- end }} |
| 36 | |
Ajay Lotan Thakur | a2e2adb | 2022-06-06 13:46:30 -0600 | [diff] [blame] | 37 | {{- if not (hasKey $amfcfg.configuration "nfKafka") -}} |
| 38 | {{- $_ := .Values.kafka.nfKafka | set $amfcfg.configuration "nfKafka" -}} |
| 39 | {{- $_ := .Values.kafka.deploy | set $amfcfg.configuration.nfKafka "enable" -}} |
| 40 | {{- end }} |
Ajay Lotan Thakur | 6de3b78 | 2022-04-14 08:41:12 -0600 | [diff] [blame] | 41 | |
badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 42 | {{- end }} |
| 43 | |
| 44 | |
| 45 | --- |
| 46 | apiVersion: v1 |
| 47 | kind: ConfigMap |
| 48 | metadata: |
| 49 | name: amf |
| 50 | labels: |
| 51 | {{ tuple "amf" . | include "5g-control-plane.metadata_labels" | indent 4 }} |
| 52 | data: |
| 53 | amf-run.sh: | |
| 54 | {{ tuple "bin/_amf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }} |
| 55 | {{- if not .Values.config.useExistingConfigMap -}} |
| 56 | {{- range $key, $value := .Values.config.amf.cfgFiles }} |
| 57 | {{ $key }}: |- |
| 58 | {{ toYaml $value | indent 4 }} |
| 59 | {{- end }} |
| 60 | {{- end }} |
| 61 | {{- end }} |