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 | |
badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 25 | {{- if not (hasKey $amfcfg "logger") -}} |
| 26 | {{- $_ := .Values.config.logger | set $amfcfg "logger" -}} |
| 27 | {{- end }} |
| 28 | |
Ajay Lotan Thakur | 6de3b78 | 2022-04-14 08:41:12 -0600 | [diff] [blame] | 29 | {{- if not (hasKey $amfcfg.configuration "enableSctpLb") -}} |
| 30 | {{- $_ := .Values.config.sctplb.deploy | set $amfcfg.configuration "enableSctpLb" -}} |
| 31 | {{- end }} |
| 32 | |
| 33 | |
badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 34 | {{- end }} |
| 35 | |
| 36 | |
| 37 | --- |
| 38 | apiVersion: v1 |
| 39 | kind: ConfigMap |
| 40 | metadata: |
| 41 | name: amf |
| 42 | labels: |
| 43 | {{ tuple "amf" . | include "5g-control-plane.metadata_labels" | indent 4 }} |
| 44 | data: |
| 45 | amf-run.sh: | |
| 46 | {{ tuple "bin/_amf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }} |
| 47 | {{- if not .Values.config.useExistingConfigMap -}} |
| 48 | {{- range $key, $value := .Values.config.amf.cfgFiles }} |
| 49 | {{ $key }}: |- |
| 50 | {{ toYaml $value | indent 4 }} |
| 51 | {{- end }} |
| 52 | {{- end }} |
| 53 | {{- end }} |