Badhrinath | 987e1d8 | 2020-11-20 13:23:58 -0600 | [diff] [blame] | 1 | {{/* |
| 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 Moon | 6a65148 | 2021-02-26 01:46:44 -0800 | [diff] [blame] | 8 | |
Hyunsun Moon | c73636b | 2021-03-24 15:47:08 -0700 | [diff] [blame] | 9 | {{- if not .Values.config.useExistingConfigMap -}} |
Hyunsun Moon | 6a65148 | 2021-02-26 01:46:44 -0800 | [diff] [blame] | 10 | {{- $pcfcfg := index .Values.config.pcf.cfgFiles "pcfcfg.conf" }} |
| 11 | {{- $sbi := index $pcfcfg.configuration "sbi" }} |
Hyunsun Moon | 3c2b340 | 2021-07-08 16:28:23 -0700 | [diff] [blame] | 12 | {{- $config := index $pcfcfg "configuration" }} |
Hyunsun Moon | 6a65148 | 2021-02-26 01:46:44 -0800 | [diff] [blame] | 13 | |
Ajay Lotan Thakur | ef182f4 | 2021-05-25 16:41:19 -0500 | [diff] [blame] | 14 | {{- if not (hasKey $pcfcfg "logger") -}} |
| 15 | {{- $_ := .Values.config.logger | set $pcfcfg "logger" -}} |
| 16 | {{- end }} |
| 17 | |
Hyunsun Moon | 6a65148 | 2021-02-26 01:46:44 -0800 | [diff] [blame] | 18 | {{- if not (hasKey $sbi "port") -}} |
| 19 | {{- $_ := .Values.config.pcf.sbi.port | set $sbi "port" -}} |
| 20 | {{- end }} |
Hyunsun Moon | 3c2b340 | 2021-07-08 16:28:23 -0700 | [diff] [blame] | 21 | |
| 22 | {{- if not (hasKey $config "mongodb") -}} |
| 23 | {{- $_ := dict "name" .Values.config.mongodb.name "url" .Values.config.mongodb.url | set $config "mongodb" -}} |
| 24 | {{- end }} |
Hyunsun Moon | c73636b | 2021-03-24 15:47:08 -0700 | [diff] [blame] | 25 | {{- end }} |
Hyunsun Moon | 6a65148 | 2021-02-26 01:46:44 -0800 | [diff] [blame] | 26 | |
Badhrinath | 987e1d8 | 2020-11-20 13:23:58 -0600 | [diff] [blame] | 27 | --- |
| 28 | apiVersion: v1 |
| 29 | kind: ConfigMap |
| 30 | metadata: |
| 31 | name: pcf |
| 32 | labels: |
| 33 | {{ tuple "pcf" . | include "5g-control-plane.metadata_labels" | indent 4 }} |
| 34 | data: |
| 35 | pcf-run.sh: | |
| 36 | {{ tuple "bin/_pcf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }} |
Hyunsun Moon | c73636b | 2021-03-24 15:47:08 -0700 | [diff] [blame] | 37 | {{- if not .Values.config.useExistingConfigMap -}} |
Hyunsun Moon | 6a65148 | 2021-02-26 01:46:44 -0800 | [diff] [blame] | 38 | {{- range $key, $value := .Values.config.pcf.cfgFiles }} |
Badhrinath | 987e1d8 | 2020-11-20 13:23:58 -0600 | [diff] [blame] | 39 | {{ $key }}: |- |
| 40 | {{ toYaml $value | indent 4 }} |
| 41 | {{- end }} |
| 42 | {{- end }} |
Hyunsun Moon | c73636b | 2021-03-24 15:47:08 -0700 | [diff] [blame] | 43 | {{- end }} |