Add an ability to use existing configMap for Kustomize support
Change-Id: Id331042cf363d40ec3d8c0dfd0dfce90fe2dc0fb
diff --git a/omec/5g-control-plane/templates/configmap-amf.yaml b/omec/5g-control-plane/templates/configmap-amf.yaml
index d731378..675e85b 100644
--- a/omec/5g-control-plane/templates/configmap-amf.yaml
+++ b/omec/5g-control-plane/templates/configmap-amf.yaml
@@ -6,6 +6,7 @@
{{- if .Values.config.amf.deploy }}
+{{- if not .Values.config.useExistingConfigMap -}}
{{- $amfcfg := index .Values.config.amf.cfgFiles "amfcfg.conf" }}
{{- $sbi := index $amfcfg.configuration "sbi" }}
@@ -22,6 +23,7 @@
{{- if not (hasKey $amfcfg.configuration "ngapIpList") -}}
{{- $_ := list "POD_IP" | set $amfcfg.configuration "ngapIpList" -}}
{{- end }}
+{{- end }}
---
apiVersion: v1
@@ -33,8 +35,10 @@
data:
amf-run.sh: |
{{ tuple "bin/_amf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
+{{- if not .Values.config.useExistingConfigMap -}}
{{- range $key, $value := .Values.config.amf.cfgFiles }}
{{ $key }}: |-
{{ toYaml $value | indent 4 }}
{{- end }}
{{- end }}
+{{- end }}