blob: d741d056a4656c2f8468fa86c03c70febd59402d [file] [log] [blame]
{{/*
# Copyright 2020-present Open Networking Foundation
# SPDX-License-Identifier: Apache-2.0
*/}}
{{- if .Values.config.amf.deploy }}
{{- if not .Values.config.useExistingConfigMap -}}
{{- $amfcfg := index .Values.config.amf.cfgFiles "amfcfg.conf" }}
{{- $sbi := index $amfcfg.configuration "sbi" }}
{{- if not (hasKey $sbi "port") -}}
{{- $_ := .Values.config.amf.sbi.port | set $sbi "port" -}}
{{- end }}
{{- if not (hasKey $amfcfg.configuration "ngappPort") -}}
{{- $_ := .Values.config.amf.ngapp.port | set $amfcfg.configuration "ngappPort" -}}
{{- end }}
{{- if not (hasKey $amfcfg.configuration "sctpGrpcPort") -}}
{{- $_ := .Values.config.amf.sctp_grpc.port | set $amfcfg.configuration "sctpGrpcPort" -}}
{{- end }}
{{- if not (hasKey $amfcfg.configuration "mongodb") -}}
{{- $_ := dict "name" .Values.config.mongodb.name "url" .Values.config.mongodb.url | set $amfcfg.configuration "mongodb" -}}
{{- end }}
{{- if not (hasKey $amfcfg "logger") -}}
{{- $_ := .Values.config.logger | set $amfcfg "logger" -}}
{{- end }}
{{- if not (hasKey $amfcfg.configuration "enableSctpLb") -}}
{{- $_ := .Values.config.sctplb.deploy | set $amfcfg.configuration "enableSctpLb" -}}
{{- end }}
{{- if not (hasKey $amfcfg.configuration "nfKafka") -}}
{{- $_ := .Values.kafka.nfKafka | set $amfcfg.configuration "nfKafka" -}}
{{- $_ := .Values.kafka.deploy | set $amfcfg.configuration.nfKafka "enable" -}}
{{- end }}
{{- end }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: amf
labels:
{{ tuple "amf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
data:
amf-run.sh: |
{{ tuple "bin/_amf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
{{- if not .Values.config.useExistingConfigMap -}}
{{- range $key, $value := .Values.config.amf.cfgFiles }}
{{ $key }}: |-
{{ toYaml $value | indent 4 }}
{{- end }}
{{- end }}
{{- end }}