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