blob: a1a8d5cd91447af113369dd33dfcfc68870a4e58 [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.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 }}