Add an ability to use existing configMap for Kustomize support
Change-Id: Id331042cf363d40ec3d8c0dfd0dfce90fe2dc0fb
diff --git a/omec/5g-control-plane/templates/configmap-webui.yaml b/omec/5g-control-plane/templates/configmap-webui.yaml
index 14657ed..f4581c3 100644
--- a/omec/5g-control-plane/templates/configmap-webui.yaml
+++ b/omec/5g-control-plane/templates/configmap-webui.yaml
@@ -6,11 +6,13 @@
{{- if .Values.config.webui.deploy }}
+{{- if not .Values.config.useExistingConfigMap -}}
{{- $webuicfg := index .Values.config.webui.cfgFiles "webuicfg.conf" }}
{{- $config := index $webuicfg "configuration" }}
{{- if not (hasKey $config "mongodb") -}}
{{- $_ := dict "name" .Values.config.mongodb.name "url" .Values.config.mongodb.url | set $config "mongodb" -}}
{{- end }}
+{{- end }}
---
apiVersion: v1
@@ -22,8 +24,10 @@
data:
webui-run.sh: |
{{ tuple "bin/_webui-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
+{{- if not .Values.config.useExistingConfigMap -}}
{{- range $key, $value := .Values.config.webui.cfgFiles }}
{{ $key }}: |-
{{ toYaml $value | indent 4 }}
{{- end }}
{{- end }}
+{{- end }}