blob: 9c6aefc5918262679aab4efca5b3c7bff3f46a96 [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.udr.deploy }}
8
9{{- if not .Values.config.useExistingConfigMap -}}
10{{- $udrcfg := index .Values.config.udr.cfgFiles "udrcfg.conf" }}
11{{- $config := index $udrcfg "configuration" }}
12{{- $sbi := index $config "sbi" }}
13
14{{- if not (hasKey $config "mongodb") -}}
15{{- $_ := dict "name" .Values.config.mongodb.name "url" .Values.config.mongodb.url | set $config "mongodb" -}}
16{{- end }}
17
18{{- if not (hasKey $udrcfg "logger") -}}
19{{- $_ := .Values.config.logger | set $udrcfg "logger" -}}
20{{- end }}
21
22{{- if not (hasKey $sbi "port") -}}
23{{- $_ := .Values.config.udr.sbi.port | set $sbi "port" -}}
24{{- end }}
25{{- end }}
26
27---
28apiVersion: v1
29kind: ConfigMap
30metadata:
31 name: udr
32 labels:
33{{ tuple "udr" . | include "5g-control-plane.metadata_labels" | indent 4 }}
34data:
35 udr-run.sh: |
36{{ tuple "bin/_udr-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
37{{- if not .Values.config.useExistingConfigMap -}}
38{{- range $key, $value := .Values.config.udr.cfgFiles }}
39 {{ $key }}: |-
40{{ toYaml $value | indent 4 }}
41{{- end }}
42{{- end }}
43{{- end }}