blob: 04ac1e190a5bb60f0a266cc0b7fed9e063d60bbc [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 }}
17{{- if not (hasKey $config "MongoDBUrl") -}}
18{{- $_ := .Values.config.mongodb.url | set $config "MongoDBUrl" -}}
19{{- end }}
20{{- if not (hasKey $config "DefaultServiceIP") -}}
21{{- $_ := "POD_IP" | set $config "DefaultServiceIP" -}}
22{{- end }}
23
Hyunsun Moon6a651482021-02-26 01:46:44 -080024{{- if not (hasKey $sbi "port") -}}
25{{- $_ := .Values.config.nrf.sbi.port | set $sbi "port" -}}
26{{- end }}
Hyunsun Moonc73636b2021-03-24 15:47:08 -070027{{- end }}
Hyunsun Moon6a651482021-02-26 01:46:44 -080028
Badhrinath987e1d82020-11-20 13:23:58 -060029---
30apiVersion: v1
31kind: ConfigMap
32metadata:
33 name: nrf
34 labels:
35{{ tuple "nrf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
36data:
37 nrf-run.sh: |
38{{ tuple "bin/_nrf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
Hyunsun Moonc73636b2021-03-24 15:47:08 -070039{{- if not .Values.config.useExistingConfigMap -}}
Hyunsun Moon6a651482021-02-26 01:46:44 -080040{{- range $key, $value := .Values.config.nrf.cfgFiles }}
Badhrinath987e1d82020-11-20 13:23:58 -060041 {{ $key }}: |-
42{{ toYaml $value | indent 4 }}
43{{- end }}
44{{- end }}
Hyunsun Moonc73636b2021-03-24 15:47:08 -070045{{- end }}