SEBA-686 Enable multiple Ponsim OLTs

Change-Id: Ia8cc47492010bcd98f0a8800f70386cd5ca5342b
diff --git a/mininet/templates/_helpers.tpl b/mininet/templates/_helpers.tpl
index 31212af..8396f02 100644
--- a/mininet/templates/_helpers.tpl
+++ b/mininet/templates/_helpers.tpl
@@ -46,3 +46,22 @@
 {{- define "mininet.chart" -}}
 {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
 {{- end -}}
+
+{{/*
+Generate the CNI annotations depending on number of OLTs
+*/}}
+{{- define "mininet.cni" -}}
+{{- printf "calico" -}}
+{{- range $i, $junk := until (.Values.numOlts|int) -}}
+{{- printf ",nni%d" $i -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Generate the DHCP subnets depending on number of OLTs
+*/}}
+{{- define "mininet.dhcp_range" -}}
+{{- range $i, $junk := until (.Values.numOlts|int) -}}
+{{- printf " --dhcp-range=172.18.%d.50,172.18.%d.150,12h" $i $i -}}
+{{- end -}}
+{{- end -}}
\ No newline at end of file
diff --git a/mininet/templates/deployment.yaml b/mininet/templates/deployment.yaml
index f75041e..571e024 100644
--- a/mininet/templates/deployment.yaml
+++ b/mininet/templates/deployment.yaml
@@ -33,10 +33,8 @@
       labels:
         app: {{ template "mininet.name" . }}
         release: {{ .Release.Name }}
-    {{- with .Values.annotations }}
       annotations:
-{{ toYaml . | indent 8 }}
-    {{- end }}
+        cni: {{ template "mininet.cni" . }}
     spec:
       containers:
         - name: {{ .Chart.Name }}