blob: dcb9bfecb8c9155c5519065f156ba939bef2c903 [file] [log] [blame]
badhri854c028b32021-11-03 18:24:05 -05001{{/*
2# Copyright 2020-present Open Networking Foundation
3
4# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
5*/}}
6
7{{- if .Values.config.pcf.deploy }}
8
9{{- if not .Values.config.useExistingConfigMap -}}
10{{- $pcfcfg := index .Values.config.pcf.cfgFiles "pcfcfg.conf" }}
11{{- $sbi := index $pcfcfg.configuration "sbi" }}
12{{- $config := index $pcfcfg "configuration" }}
13
14{{- if not (hasKey $pcfcfg "logger") -}}
15{{- $_ := .Values.config.logger | set $pcfcfg "logger" -}}
16{{- end }}
17
18{{- if not (hasKey $sbi "port") -}}
19{{- $_ := .Values.config.pcf.sbi.port | set $sbi "port" -}}
20{{- end }}
21
22{{- if not (hasKey $config "mongodb") -}}
23{{- $_ := dict "name" .Values.config.mongodb.name "url" .Values.config.mongodb.url | set $config "mongodb" -}}
24{{- end }}
25{{- end }}
26
27---
28apiVersion: v1
29kind: ConfigMap
30metadata:
31 name: pcf
32 labels:
33{{ tuple "pcf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
34data:
35 pcf-run.sh: |
36{{ tuple "bin/_pcf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
37{{- if not .Values.config.useExistingConfigMap -}}
38{{- range $key, $value := .Values.config.pcf.cfgFiles }}
39 {{ $key }}: |-
40{{ toYaml $value | indent 4 }}
41{{- end }}
42{{- end }}
43{{- end }}