blob: da24f205c3c5b2648ae59184c799702ac35e48a6 [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
9{{- $nrfcfg := index .Values.config.nrf.cfgFiles "nrfcfg.conf" }}
10{{- $config := index $nrfcfg "configuration" }}
11{{- $sbi := index $config "sbi" }}
12
13{{- if not (hasKey $config "MongoDBName") -}}
14{{- $_ := .Values.config.mongodb.name | set $config "MongoDBName" -}}
15{{- end }}
16{{- if not (hasKey $config "MongoDBUrl") -}}
17{{- $_ := .Values.config.mongodb.url | set $config "MongoDBUrl" -}}
18{{- end }}
19{{- if not (hasKey $config "DefaultServiceIP") -}}
20{{- $_ := "POD_IP" | set $config "DefaultServiceIP" -}}
21{{- end }}
22
23{{- if not (hasKey $sbi "registerIPv4") -}}
24{{- $_ := "POD_IP" | set $sbi "registerIPv4" -}}
25{{- end }}
26{{- if not (hasKey $sbi "bindingIPv4") -}}
27{{- $_ := "POD_IP" | set $sbi "bindingIPv4" -}}
28{{- end }}
29{{- if not (hasKey $sbi "port") -}}
30{{- $_ := .Values.config.nrf.sbi.port | set $sbi "port" -}}
31{{- end }}
32
Badhrinath987e1d82020-11-20 13:23:58 -060033---
34apiVersion: v1
35kind: ConfigMap
36metadata:
37 name: nrf
38 labels:
39{{ tuple "nrf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
40data:
41 nrf-run.sh: |
42{{ tuple "bin/_nrf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
Hyunsun Moon6a651482021-02-26 01:46:44 -080043{{- range $key, $value := .Values.config.nrf.cfgFiles }}
Badhrinath987e1d82020-11-20 13:23:58 -060044 {{ $key }}: |-
45{{ toYaml $value | indent 4 }}
46{{- end }}
47{{- end }}