blob: 75e07550026497292a98f80956b3f64157be9f36 [file] [log] [blame]
{{/*
# Copyright 2020-present Open Networking Foundation
# SPDX-License-Identifier: Apache-2.0
*/}}
{{- if .Values.config.gnbsim.deploy }}
{{- if not .Values.config.useExistingConfigMap }}
{{- $config := index .Values.config "gnbsim" }}
{{- $gnbconf := index .Values.config.gnbsim.yamlCfgFiles "gnb.conf" }}
{{- $configuration := index $gnbconf "configuration" }}
{{- if not (hasKey $configuration "goProfile") -}}
{{- $_ := dict "enable" .Values.config.gnbsim.goProfile.enable "port" .Values.config.gnbsim.goProfile.port | set $configuration "goProfile" -}}
{{- end }}
{{- if not (hasKey $configuration "httpServer") -}}
{{- $_ := dict "enable" .Values.config.gnbsim.httpServer.enable "ipAddr" .Values.config.gnbsim.httpServer.ipAddr "port" .Values.config.gnbsim.httpServer.port | set $configuration "httpServer" -}}
{{- end }}
{{- if not (hasKey $configuration "singleInterface") -}}
{{- $_ := .Values.config.gnbsim.singleInterface | set $configuration "singleInterface" -}}
{{- end }}
{{- $_ := .Values.config.gnbsim.networkTopo | set $configuration "networkTopo" -}}
{{- end }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: gnbsim
labels:
{{ tuple "gnbsim" . | include "5g-ransim-plane.metadata_labels" | indent 4 }}
data:
gnbsim-run.sh: |
{{ tuple "bin/_gnbsim-run.sh.tpl" . | include "5g-ransim-plane.template" | indent 4 }}
{{- range $key, $value := .Values.config.gnbsim.yamlCfgFiles }}
{{ $key }}: |-
{{ toYaml $value | indent 4 }}
{{- end }}
{{- end }}