diff --git a/charts/telegraf-operator/Chart.yaml b/charts/telegraf-operator/Chart.yaml index 15b0deb5..0320cc06 100644 --- a/charts/telegraf-operator/Chart.yaml +++ b/charts/telegraf-operator/Chart.yaml @@ -30,7 +30,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 1.4.0 +version: 1.5.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. diff --git a/charts/telegraf-operator/templates/_helpers.tpl b/charts/telegraf-operator/templates/_helpers.tpl index 3db3ead8..574e1709 100644 --- a/charts/telegraf-operator/templates/_helpers.tpl +++ b/charts/telegraf-operator/templates/_helpers.tpl @@ -99,6 +99,11 @@ webhooks: - DELETE resources: - pods + {{- if not (empty .Values.namespaceSelector) }} + scope: "Namespaced" + {{- end }} + namespaceSelector: + {{- toYaml .Values.namespaceSelector | nindent 4 }} --- apiVersion: v1 kind: Secret diff --git a/charts/telegraf-operator/templates/mutatingwebhookconfiguration.yml b/charts/telegraf-operator/templates/mutatingwebhookconfiguration.yml index 33e022c9..77255ff1 100644 --- a/charts/telegraf-operator/templates/mutatingwebhookconfiguration.yml +++ b/charts/telegraf-operator/templates/mutatingwebhookconfiguration.yml @@ -28,4 +28,9 @@ webhooks: - DELETE resources: - pods + {{- if not (empty .Values.namespaceSelector) }} + scope: "Namespaced" + {{- end }} + namespaceSelector: + {{- toYaml .Values.namespaceSelector | nindent 4 }} {{- end }} diff --git a/charts/telegraf-operator/values.yaml b/charts/telegraf-operator/values.yaml index 93303719..681348ff 100644 --- a/charts/telegraf-operator/values.yaml +++ b/charts/telegraf-operator/values.yaml @@ -57,3 +57,4 @@ enableDefaultInternalPlugin: true # allow hot reload ; disabled by default to support versions of telegraf # that do not support hot-reload and --watch-config flag hotReload: false +namespaceSelector: {}