Add an ability to use existing configMap for Kustomize support
Change-Id: Id331042cf363d40ec3d8c0dfd0dfce90fe2dc0fb
diff --git a/omec/5g-control-plane/templates/configmap-pcf.yaml b/omec/5g-control-plane/templates/configmap-pcf.yaml
index 9d5147c..b0af3f7 100644
--- a/omec/5g-control-plane/templates/configmap-pcf.yaml
+++ b/omec/5g-control-plane/templates/configmap-pcf.yaml
@@ -6,6 +6,7 @@
{{- if .Values.config.pcf.deploy }}
+{{- if not .Values.config.useExistingConfigMap -}}
{{- $pcfcfg := index .Values.config.pcf.cfgFiles "pcfcfg.conf" }}
{{- $sbi := index $pcfcfg.configuration "sbi" }}
@@ -18,6 +19,7 @@
{{- if not (hasKey $sbi "port") -}}
{{- $_ := .Values.config.pcf.sbi.port | set $sbi "port" -}}
{{- end }}
+{{- end }}
---
apiVersion: v1
@@ -29,8 +31,10 @@
data:
pcf-run.sh: |
{{ tuple "bin/_pcf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
+{{- if not .Values.config.useExistingConfigMap -}}
{{- range $key, $value := .Values.config.pcf.cfgFiles }}
{{ $key }}: |-
{{ toYaml $value | indent 4 }}
{{- end }}
{{- end }}
+{{- end }}