blob: 5af01f1243b1705d12896ab1607e4210aabbfb3b [file] [log] [blame]
badhri854c028b32021-11-03 18:24:05 -05001{{/*
2# Copyright 2020-present Open Networking Foundation
3
Ajay Lotan Thakur03189d22022-02-10 14:06:03 -06004# SPDX-License-Identifier: Apache-2.0
badhri854c028b32021-11-03 18:24:05 -05005*/}}
6
7{{- if .Values.config.nrf.deploy }}
8
9{{- if not .Values.config.useExistingConfigMap -}}
10{{- $nrfcfg := index .Values.config.nrf.cfgFiles "nrfcfg.conf" }}
11{{- $config := index $nrfcfg "configuration" }}
12{{- $sbi := index $config "sbi" }}
13
Ajay Lotan Thakure7d9a252022-07-07 16:02:07 -060014{{- if not (hasKey $config "mongodb") -}}
15{{- $_ := dict "name" .Values.config.mongodb.name "url" .Values.config.mongodb.url | set $config "mongodb" -}}
16{{- end }}
17
badhri854c028b32021-11-03 18:24:05 -050018{{- if not (hasKey $config "MongoDBName") -}}
19{{- $_ := .Values.config.mongodb.name | set $config "MongoDBName" -}}
20{{- end }}
21
22{{- if not (hasKey $config "MongoDBUrl") -}}
23{{- $_ := .Values.config.mongodb.url | set $config "MongoDBUrl" -}}
24{{- end }}
25
26{{- if not (hasKey $nrfcfg "logger") -}}
27{{- $_ := .Values.config.logger | set $nrfcfg "logger" -}}
28{{- end }}
29
30{{- if not (hasKey $sbi "port") -}}
31{{- $_ := .Values.config.nrf.sbi.port | set $sbi "port" -}}
32{{- end }}
33{{- end }}
34
35---
36apiVersion: v1
37kind: ConfigMap
38metadata:
39 name: nrf
40 labels:
41{{ tuple "nrf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
42data:
43 nrf-run.sh: |
44{{ tuple "bin/_nrf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
45{{- if not .Values.config.useExistingConfigMap -}}
46{{- range $key, $value := .Values.config.nrf.cfgFiles }}
47 {{ $key }}: |-
48{{ toYaml $value | indent 4 }}
49{{- end }}
50{{- end }}
51{{- end }}