Add an ability to use existing configMap for Kustomize support
Change-Id: Id331042cf363d40ec3d8c0dfd0dfce90fe2dc0fb
diff --git a/omec/5g-control-plane/templates/configmap-udr.yaml b/omec/5g-control-plane/templates/configmap-udr.yaml
index 3508ac3..5ce0dc4 100644
--- a/omec/5g-control-plane/templates/configmap-udr.yaml
+++ b/omec/5g-control-plane/templates/configmap-udr.yaml
@@ -6,6 +6,7 @@
{{- if .Values.config.udr.deploy }}
+{{- if not .Values.config.useExistingConfigMap -}}
{{- $udrcfg := index .Values.config.udr.cfgFiles "udrcfg.conf" }}
{{- $config := index $udrcfg "configuration" }}
{{- $sbi := index $config "sbi" }}
@@ -23,6 +24,7 @@
{{- if not (hasKey $sbi "port") -}}
{{- $_ := .Values.config.udr.sbi.port | set $sbi "port" -}}
{{- end }}
+{{- end }}
---
apiVersion: v1
@@ -34,8 +36,10 @@
data:
udr-run.sh: |
{{ tuple "bin/_udr-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
+{{- if not .Values.config.useExistingConfigMap -}}
{{- range $key, $value := .Values.config.udr.cfgFiles }}
{{ $key }}: |-
{{ toYaml $value | indent 4 }}
{{- end }}
{{- end }}
+{{- end }}