From d27aa5249e6dc11ee21ffc2691fbbc816ac8a1bc Mon Sep 17 00:00:00 2001 From: rahtr Date: Mon, 1 May 2023 11:58:09 -0400 Subject: [PATCH 1/2] Update template to support watch namespace --- templates/helm/templates/_helpers.tpl | 2 +- templates/helm/values.schema.json | 3 +++ templates/helm/values.yaml.tpl | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/templates/helm/templates/_helpers.tpl b/templates/helm/templates/_helpers.tpl index 973704c1..391d5de3 100644 --- a/templates/helm/templates/_helpers.tpl +++ b/templates/helm/templates/_helpers.tpl @@ -33,7 +33,7 @@ If release name contains chart name it will be used as a full name. {{- define "watch-namespace" -}} {{- if eq .Values.installScope "namespace" -}} -{{- .Release.Namespace -}} +{{ .Values.watchNamespace | default .Release.Namespace }} {{- end -}} {{- end -}} diff --git a/templates/helm/values.schema.json b/templates/helm/values.schema.json index d5a8d35e..79fd18ce 100644 --- a/templates/helm/values.schema.json +++ b/templates/helm/values.schema.json @@ -196,6 +196,9 @@ "type": "string", "enum": ["cluster", "namespace"] }, + "watchNamespace": { + "type": "string" + }, "resourceTags": { "type": "array", "items": { diff --git a/templates/helm/values.yaml.tpl b/templates/helm/values.yaml.tpl index aea95408..8ef2a8d6 100644 --- a/templates/helm/values.yaml.tpl +++ b/templates/helm/values.yaml.tpl @@ -72,6 +72,10 @@ log: # cluster wide. installScope: cluster +# Set the value of the "namespace" to be watched by the controller +# This would only work if installScope is set to "namespace". If left empty it would watch the release namespace by default. +watchNamespace: "" + resourceTags: # Configures the ACK service controller to always set key/value pairs tags on # resources that it manages. From c7da65bfd1366b85ab30be46f56129933115bac9 Mon Sep 17 00:00:00 2001 From: rahtr <31742059+rahtr@users.noreply.github.com> Date: Mon, 1 May 2023 16:06:53 -0400 Subject: [PATCH 2/2] Update templates/helm/values.yaml.tpl Re-worded param definition. Co-authored-by: Nicholas Thomson --- templates/helm/values.yaml.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/helm/values.yaml.tpl b/templates/helm/values.yaml.tpl index 8ef2a8d6..182982fe 100644 --- a/templates/helm/values.yaml.tpl +++ b/templates/helm/values.yaml.tpl @@ -73,7 +73,7 @@ log: installScope: cluster # Set the value of the "namespace" to be watched by the controller -# This would only work if installScope is set to "namespace". If left empty it would watch the release namespace by default. +# This value is only used when the `installScope` is set to "namespace". If left empty, the default value is the release namespace for the chart. watchNamespace: "" resourceTags: