From 74a1946228d045d64217c1545eb6c2284cca04ff Mon Sep 17 00:00:00 2001 From: Manuel Zapf Date: Wed, 25 Sep 2019 17:30:07 +0200 Subject: [PATCH] Make Ignorenamespaces better manageable --- helm/chart/maesh/templates/_helpers.tpl | 11 ++++++++++- .../templates/controller/controller-deployment.yaml | 4 +++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/helm/chart/maesh/templates/_helpers.tpl b/helm/chart/maesh/templates/_helpers.tpl index 7ba012f9f..b63389302 100644 --- a/helm/chart/maesh/templates/_helpers.tpl +++ b/helm/chart/maesh/templates/_helpers.tpl @@ -7,10 +7,19 @@ Define the Chart version Label {{- define "maesh.chartLabel" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version -}} {{- end -}} - {{/* Define the templated image with tag */}} {{- define "maesh.controllerImage" -}} {{- printf "%s:%s" .Values.controller.image.name ( .Values.controller.image.tag | default .Chart.AppVersion ) -}} {{- end -}} +{{/* +Define the ignoreNamespaces List +*/}} +{{- define "maesh.controllerIgnoreNamespaces" -}} + --ignoreNamespaces= + {{- range $idx, $ns := .Values.controller.ignoreNamespaces }} + {{- if $idx }},{{ end }} + {{- $ns }} + {{- end -}} +{{- end -}} diff --git a/helm/chart/maesh/templates/controller/controller-deployment.yaml b/helm/chart/maesh/templates/controller/controller-deployment.yaml index 5f016a446..3c5d354c7 100644 --- a/helm/chart/maesh/templates/controller/controller-deployment.yaml +++ b/helm/chart/maesh/templates/controller/controller-deployment.yaml @@ -73,7 +73,9 @@ spec: - "--smi" {{- end }} - "--namespace=$(POD_NAMESPACE)" - - "--ignorenamespaces={{- .Values.controller.ignoreNamespaces }}" + {{- if .Values.controller.ignoreNamespaces }} + - {{ include "maesh.controllerIgnoreNamespaces" . | quote }} + {{- end }} env: - name: POD_IP valueFrom: