blob: ccb236b925a82699c4f7690337ed12095b82c7e7 [file] [log] [blame]
Badhrinath987e1d82020-11-20 13:23:58 -06001{{/*
2# Copyright 2020-present Open Networking Foundation
3
4# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
5*/}}
6
7{{- if .Values.config.nrf.deploy }}
Hyunsun Moon6a651482021-02-26 01:46:44 -08008
Hyunsun Moonc73636b2021-03-24 15:47:08 -07009{{- if not .Values.config.useExistingConfigMap -}}
Hyunsun Moon6a651482021-02-26 01:46:44 -080010{{- $nrfcfg := index .Values.config.nrf.cfgFiles "nrfcfg.conf" }}
11{{- $config := index $nrfcfg "configuration" }}
12{{- $sbi := index $config "sbi" }}
13
14{{- if not (hasKey $config "MongoDBName") -}}
15{{- $_ := .Values.config.mongodb.name | set $config "MongoDBName" -}}
16{{- end }}
Ajay Lotan Thakuref182f42021-05-25 16:41:19 -050017
Hyunsun Moon6a651482021-02-26 01:46:44 -080018{{- if not (hasKey $config "MongoDBUrl") -}}
19{{- $_ := .Values.config.mongodb.url | set $config "MongoDBUrl" -}}
20{{- end }}
Ajay Lotan Thakuref182f42021-05-25 16:41:19 -050021
Ajay Lotan Thakuref182f42021-05-25 16:41:19 -050022{{- if not (hasKey $nrfcfg "logger") -}}
23{{- $_ := .Values.config.logger | set $nrfcfg "logger" -}}
24{{- end }}
25
Hyunsun Moon6a651482021-02-26 01:46:44 -080026{{- if not (hasKey $sbi "port") -}}
27{{- $_ := .Values.config.nrf.sbi.port | set $sbi "port" -}}
28{{- end }}
Hyunsun Moonc73636b2021-03-24 15:47:08 -070029{{- end }}
Hyunsun Moon6a651482021-02-26 01:46:44 -080030
Badhrinath987e1d82020-11-20 13:23:58 -060031---
32apiVersion: v1
33kind: ConfigMap
34metadata:
35 name: nrf
36 labels:
37{{ tuple "nrf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
38data:
39 nrf-run.sh: |
40{{ tuple "bin/_nrf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
Hyunsun Moonc73636b2021-03-24 15:47:08 -070041{{- if not .Values.config.useExistingConfigMap -}}
Hyunsun Moon6a651482021-02-26 01:46:44 -080042{{- range $key, $value := .Values.config.nrf.cfgFiles }}
Badhrinath987e1d82020-11-20 13:23:58 -060043 {{ $key }}: |-
44{{ toYaml $value | indent 4 }}
45{{- end }}
46{{- end }}
Hyunsun Moonc73636b2021-03-24 15:47:08 -070047{{- end }}