blob: 65fe2f5101391950ebac30dba900f2c2fb8406ec [file] [log] [blame]
{{/*
# SPDX-FileCopyrightText: 2022-present Intel Corporation
# Copyright 2020-present Open Networking Foundation
# SPDX-License-Identifier: Apache-2.0
*/}}
{{- if .Values.config.smf.deploy }}
{{- if not .Values.config.useExistingConfigMap -}}
{{- $smfcfg := index .Values.config.smf.cfgFiles "smfcfg.conf" }}
{{- $sbi := index $smfcfg.configuration "sbi" }}
{{- if not (hasKey $smfcfg.configuration "mongodb") -}}
{{- $_ := dict "name" .Values.config.mongodb.name "url" .Values.config.mongodb.url | set $smfcfg.configuration "mongodb" -}}
{{- end }}
{{- if not (hasKey $smfcfg "logger") -}}
{{- $_ := .Values.config.logger | set $smfcfg "logger" -}}
{{- end }}
{{- if not (hasKey $sbi "port") -}}
{{- $_ := .Values.config.smf.sbi.port | set $sbi "port" -}}
{{- end }}
{{- if not (hasKey $smfcfg.configuration "enableUPFAdapter") -}}
{{- $_ := .Values.config.upfadapter.deploy | set $smfcfg.configuration "enableUPFAdapter" -}}
{{- end }}
{{- if not (hasKey $smfcfg.configuration "nfKafka") -}}
{{- $_ := .Values.kafka.nfKafka | set $smfcfg.configuration "nfKafka" -}}
{{- $_ := .Values.kafka.deploy | set $smfcfg.configuration.nfKafka "enable" -}}
{{- end }}
{{- end }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: smf
labels:
{{ tuple "smf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
data:
smf-run.sh: |
{{ tuple "bin/_smf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
{{- if not .Values.config.useExistingConfigMap -}}
{{- range $key, $value := .Values.config.smf.cfgFiles }}
{{ $key }}: |-
{{ toYaml $value | indent 4 }}
{{- end }}
{{- end }}
{{- end }}