blob: 18120b0a465bc37591d51b2b694732a8883d3a06 [file] [log] [blame]
Badhrinath987e1d82020-11-20 13:23:58 -06001{{/*
2# Copyright 2020-present Open Networking Foundation
3
4# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
5*/}}
6
7{{- if .Values.config.smf.deploy }}
Hyunsun Moon6a651482021-02-26 01:46:44 -08008
Hyunsun Moonc73636b2021-03-24 15:47:08 -07009{{- if not .Values.config.useExistingConfigMap -}}
Hyunsun Moon6a651482021-02-26 01:46:44 -080010{{- $smfcfg := index .Values.config.smf.cfgFiles "smfcfg.conf" }}
11{{- $sbi := index $smfcfg.configuration "sbi" }}
12
13{{- if not (hasKey $smfcfg.configuration "pfcp") -}}
14{{- $_ := dict "addr" "POD_IP" | set $smfcfg.configuration "pfcp" -}}
15{{- end }}
16{{- if not (hasKey $sbi "registerIPv4") -}}
17{{- $_ := "POD_IP" | set $sbi "registerIPv4" -}}
18{{- end }}
19{{- if not (hasKey $sbi "bindingIPv4") -}}
20{{- $_ := "POD_IP" | set $sbi "bindingIPv4" -}}
21{{- end }}
22{{- if not (hasKey $sbi "port") -}}
23{{- $_ := .Values.config.smf.sbi.port | set $sbi "port" -}}
24{{- end }}
Hyunsun Moonc73636b2021-03-24 15:47:08 -070025{{- end }}
Hyunsun Moon6a651482021-02-26 01:46:44 -080026
Badhrinath987e1d82020-11-20 13:23:58 -060027---
28apiVersion: v1
29kind: ConfigMap
30metadata:
31 name: smf
32 labels:
33{{ tuple "smf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
34data:
35 smf-run.sh: |
36{{ tuple "bin/_smf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
Hyunsun Moonc73636b2021-03-24 15:47:08 -070037{{- if not .Values.config.useExistingConfigMap -}}
Hyunsun Moon6a651482021-02-26 01:46:44 -080038{{- range $key, $value := .Values.config.smf.cfgFiles }}
Badhrinath987e1d82020-11-20 13:23:58 -060039 {{ $key }}: |-
40{{ toYaml $value | indent 4 }}
41{{- end }}
42{{- end }}
Hyunsun Moonc73636b2021-03-24 15:47:08 -070043{{- end }}