blob: dcb9bfecb8c9155c5519065f156ba939bef2c903 [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.pcf.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{{- $pcfcfg := index .Values.config.pcf.cfgFiles "pcfcfg.conf" }}
11{{- $sbi := index $pcfcfg.configuration "sbi" }}
Hyunsun Moon3c2b3402021-07-08 16:28:23 -070012{{- $config := index $pcfcfg "configuration" }}
Hyunsun Moon6a651482021-02-26 01:46:44 -080013
Ajay Lotan Thakuref182f42021-05-25 16:41:19 -050014{{- if not (hasKey $pcfcfg "logger") -}}
15{{- $_ := .Values.config.logger | set $pcfcfg "logger" -}}
16{{- end }}
17
Hyunsun Moon6a651482021-02-26 01:46:44 -080018{{- if not (hasKey $sbi "port") -}}
19{{- $_ := .Values.config.pcf.sbi.port | set $sbi "port" -}}
20{{- end }}
Hyunsun Moon3c2b3402021-07-08 16:28:23 -070021
22{{- if not (hasKey $config "mongodb") -}}
23{{- $_ := dict "name" .Values.config.mongodb.name "url" .Values.config.mongodb.url | set $config "mongodb" -}}
24{{- end }}
Hyunsun Moonc73636b2021-03-24 15:47:08 -070025{{- end }}
Hyunsun Moon6a651482021-02-26 01:46:44 -080026
Badhrinath987e1d82020-11-20 13:23:58 -060027---
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 }}
Hyunsun Moonc73636b2021-03-24 15:47:08 -070037{{- if not .Values.config.useExistingConfigMap -}}
Hyunsun Moon6a651482021-02-26 01:46:44 -080038{{- range $key, $value := .Values.config.pcf.cfgFiles }}
Badhrinath987e1d82020-11-20 13:23:58 -060039 {{ $key }}: |-
40{{ toYaml $value | indent 4 }}
41{{- end }}
42{{- end }}
Hyunsun Moonc73636b2021-03-24 15:47:08 -070043{{- end }}