From c249482288fa39974e214a77e182c90584c6dd24 Mon Sep 17 00:00:00 2001 From: Jan Jansen Date: Mon, 23 Feb 2026 08:25:42 +0100 Subject: [PATCH 1/3] chore(chart): apply editorconfig to deployment-flags test Signed-off-by: Jan Jansen --- .../tests/deployment-flags_test.yaml | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/charts/external-dns/tests/deployment-flags_test.yaml b/charts/external-dns/tests/deployment-flags_test.yaml index 5ea1115304..cc56fe8fef 100644 --- a/charts/external-dns/tests/deployment-flags_test.yaml +++ b/charts/external-dns/tests/deployment-flags_test.yaml @@ -6,9 +6,9 @@ release: tests: - it: should provide expected default flags asserts: - - exists : + - exists: path: spec.template.spec.containers[?(@.name == "external-dns")] - - equal : + - equal: path: spec.template.spec.containers[?(@.name == "external-dns")].args value: - --log-level=info @@ -25,9 +25,9 @@ tests: txtPrefix: "" txtSuffix: "test-suffix" asserts: - - exists : + - exists: path: spec.template.spec.containers[?(@.name == "external-dns")] - - equal : + - equal: path: spec.template.spec.containers[?(@.name == "external-dns")].args value: - --log-level=info @@ -50,7 +50,7 @@ tests: set: txtSuffix: "custom-suffix" asserts: - - exists : + - exists: path: spec.template.spec.containers[?(@.name == "external-dns")] - contains: path: spec.template.spec.containers[?(@.name == "external-dns")].args @@ -103,14 +103,13 @@ tests: - --zone-id-filter=/hostedzone/Z00004 - --zone-id-filter=/hostedzone/Z00005 - - it: should allow 'extraArgs' to be a slice set: extraArgs: - - --extraArgA=valueA - - --extraArgB=valueB - - --extraArgC=valueC-1 - - --extraArgC=valueC-2 + - --extraArgA=valueA + - --extraArgB=valueB + - --extraArgC=valueC-1 + - --extraArgC=valueC-2 asserts: - equal: @@ -129,7 +128,6 @@ tests: - --extraArgC=valueC-1 - --extraArgC=valueC-2 - - it: should allow 'extraArgs' to be a map with its entries potentially being slices (lists) themselves set: extraArgs: @@ -156,13 +154,12 @@ tests: - --extraArgC=valueC-1 - --extraArgC=valueC-2 - - it: should throw error when txtPrefix and txtSuffix are set set: - txtPrefix: "test-prefix" - txtSuffix: "test-suffix" + txtPrefix: "test-prefix" + txtSuffix: "test-suffix" asserts: - - failedTemplate: + - failedTemplate: errorMessage: "'txtPrefix' and 'txtSuffix' are mutually exclusive" - it: should configure custom annotation prefix From 1a8b151edf8a50dee3d5d15b9177ed85409ddc04 Mon Sep 17 00:00:00 2001 From: Jan Jansen Date: Mon, 23 Feb 2026 09:51:48 +0100 Subject: [PATCH 2/3] feat(chart): add support for bool extraArgs Signed-off-by: Jan Jansen --- charts/external-dns/README.md | 24 ++++++++++++++++++ charts/external-dns/README.md.gotmpl | 24 ++++++++++++++++++ charts/external-dns/templates/deployment.yaml | 6 +++++ .../tests/deployment-flags_test.yaml | 25 +++++++++++++++++++ charts/external-dns/values.yaml | 20 +++++++++++++++ 5 files changed, 99 insertions(+) diff --git a/charts/external-dns/README.md b/charts/external-dns/README.md index 0bbae92591..1ee8ca3321 100644 --- a/charts/external-dns/README.md +++ b/charts/external-dns/README.md @@ -187,6 +187,30 @@ If `namespaced` is set to `true`, please ensure that `sources` my only contains | txtPrefix | string | `nil` | Specify a prefix for the domain names of TXT records created for the `txt` registry. Mutually exclusive with `txtSuffix`. | | txtSuffix | string | `nil` | Specify a suffix for the domain names of TXT records created for the `txt` registry. Mutually exclusive with `txtPrefix`. | +### Configure `extraArgs` + +An array or map can be used, with maps allowing for value overrides; maps also support slice values to use the same arg multiple times. + +Example array: +```yaml +extraArgs: + - --zone-id-filter=/hostedzone/Z00001 + - --zone-id-filter=/hostedzone/Z00002 + - --zone-id-filter=/hostedzone/Z00003 +``` + +Eample map: (supported values for map are strings, list of strings, and boolean) +```yaml +extraArgs: + extraArgA: valueA # results: "--extraArgA=valueA" + extraArgB: # rendered: "--extraArgB=valueB-1 --extraArgB=valueB-2" + - valueB-1 + - valueB-2 + extraArgC: true # results: "--extraArgC" + extraArgD: false # results: "--no-extraArgD" + extraArgE: # results: "--extraArgE" +``` + ---------------------------------------------- Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs/). diff --git a/charts/external-dns/README.md.gotmpl b/charts/external-dns/README.md.gotmpl index fc4ada14be..4c5ce8a2d0 100644 --- a/charts/external-dns/README.md.gotmpl +++ b/charts/external-dns/README.md.gotmpl @@ -89,6 +89,30 @@ If `namespaced` is set to `true`, please ensure that `sources` my only contains {{ template "chart.valuesSection" . }} +### Configure `extraArgs` + +An array or map can be used, with maps allowing for value overrides; maps also support slice values to use the same arg multiple times. + +Example array: +```yaml +extraArgs: + - --zone-id-filter=/hostedzone/Z00001 + - --zone-id-filter=/hostedzone/Z00002 + - --zone-id-filter=/hostedzone/Z00003 +``` + +Eample map: (supported values for map are strings, list of strings, and boolean) +```yaml +extraArgs: + extraArgA: valueA # results: "--extraArgA=valueA" + extraArgB: # rendered: "--extraArgB=valueB-1 --extraArgB=valueB-2" + - valueB-1 + - valueB-2 + extraArgC: true # results: "--extraArgC" + extraArgD: false # results: "--no-extraArgD" + extraArgE: # results: "--extraArgE" +``` + ---------------------------------------------- Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs/). diff --git a/charts/external-dns/templates/deployment.yaml b/charts/external-dns/templates/deployment.yaml index b213f754fd..a8877437a9 100644 --- a/charts/external-dns/templates/deployment.yaml +++ b/charts/external-dns/templates/deployment.yaml @@ -140,6 +140,12 @@ spec: {{- range $value }} - --{{ $key }}={{ tpl (. | toString) $ }} {{- end }} + {{- else if kindIs "bool" $value }} + {{- if $value }} + - --{{ $key }} + {{- else }} + - --no-{{ $key }} + {{- end }} {{- else }} - --{{ $key }}={{ tpl ($value | toString) $ }} {{- end }} diff --git a/charts/external-dns/tests/deployment-flags_test.yaml b/charts/external-dns/tests/deployment-flags_test.yaml index cc56fe8fef..a1b730c447 100644 --- a/charts/external-dns/tests/deployment-flags_test.yaml +++ b/charts/external-dns/tests/deployment-flags_test.yaml @@ -154,6 +154,31 @@ tests: - --extraArgC=valueC-1 - --extraArgC=valueC-2 + - it: should allow 'extraArgs' to be a map with its entries potentially being boolean + set: + extraArgs: + extraArgA: + no-extraArgB: + extraArgC: true + extraArgD: false + + asserts: + - equal: + path: spec.template.spec.containers[?(@.name == "external-dns")].args + value: + - --log-level=info + - --log-format=text + - --interval=1m + - --source=service + - --source=ingress + - --policy=upsert-only + - --registry=txt + - --provider=aws + - --extraArgA + - --no-extraArgB + - --extraArgC + - --no-extraArgD + - it: should throw error when txtPrefix and txtSuffix are set set: txtPrefix: "test-prefix" diff --git a/charts/external-dns/values.yaml b/charts/external-dns/values.yaml index 46fbe8f7c7..7d0688ee51 100644 --- a/charts/external-dns/values.yaml +++ b/charts/external-dns/values.yaml @@ -304,6 +304,26 @@ provider: # @schema type: [object, string] metricRelabelings: [] relabelings: [] + +# Example array: +# ```yaml +# extraArgs: +# - --zone-id-filter=/hostedzone/Z00001 +# - --zone-id-filter=/hostedzone/Z00002 +# - --zone-id-filter=/hostedzone/Z00003 +# ``` +# +# Eample map: (supported values for map are strings, list of strings, and boolean) +# ```yaml +# extraArgs: +# extraArgA: valueA +# extraArgB: +# - valueB-1 +# - valueB-2 +# extraArgC: true +# extraArgD: false +# ``` + # -- Extra arguments to provide to _ExternalDNS_. # An array or map can be used, with maps allowing for value overrides; maps also support slice values to use the same arg multiple times. extraArgs: {} # @schema type: [array, null, object]; item: string; uniqueItems: true From 88556ab9bd26d8d5f8727140e4954c0322fe0755 Mon Sep 17 00:00:00 2001 From: farodin91 Date: Sun, 1 Mar 2026 09:52:36 +0100 Subject: [PATCH 3/3] fix issues Signed-off-by: farodin91 --- charts/external-dns/README.md | 4 ++++ charts/external-dns/README.md.gotmpl | 4 ++++ .../tests/deployment-flags_test.yaml | 2 +- charts/external-dns/values.yaml | 20 ------------------- 4 files changed, 9 insertions(+), 21 deletions(-) diff --git a/charts/external-dns/README.md b/charts/external-dns/README.md index 1ee8ca3321..f5ec38d04e 100644 --- a/charts/external-dns/README.md +++ b/charts/external-dns/README.md @@ -187,11 +187,14 @@ If `namespaced` is set to `true`, please ensure that `sources` my only contains | txtPrefix | string | `nil` | Specify a prefix for the domain names of TXT records created for the `txt` registry. Mutually exclusive with `txtSuffix`. | | txtSuffix | string | `nil` | Specify a suffix for the domain names of TXT records created for the `txt` registry. Mutually exclusive with `txtPrefix`. | +## Usage + ### Configure `extraArgs` An array or map can be used, with maps allowing for value overrides; maps also support slice values to use the same arg multiple times. Example array: + ```yaml extraArgs: - --zone-id-filter=/hostedzone/Z00001 @@ -200,6 +203,7 @@ extraArgs: ``` Eample map: (supported values for map are strings, list of strings, and boolean) + ```yaml extraArgs: extraArgA: valueA # results: "--extraArgA=valueA" diff --git a/charts/external-dns/README.md.gotmpl b/charts/external-dns/README.md.gotmpl index 4c5ce8a2d0..8f7021e80a 100644 --- a/charts/external-dns/README.md.gotmpl +++ b/charts/external-dns/README.md.gotmpl @@ -89,11 +89,14 @@ If `namespaced` is set to `true`, please ensure that `sources` my only contains {{ template "chart.valuesSection" . }} +## Usage + ### Configure `extraArgs` An array or map can be used, with maps allowing for value overrides; maps also support slice values to use the same arg multiple times. Example array: + ```yaml extraArgs: - --zone-id-filter=/hostedzone/Z00001 @@ -102,6 +105,7 @@ extraArgs: ``` Eample map: (supported values for map are strings, list of strings, and boolean) + ```yaml extraArgs: extraArgA: valueA # results: "--extraArgA=valueA" diff --git a/charts/external-dns/tests/deployment-flags_test.yaml b/charts/external-dns/tests/deployment-flags_test.yaml index a1b730c447..f9b916bd6a 100644 --- a/charts/external-dns/tests/deployment-flags_test.yaml +++ b/charts/external-dns/tests/deployment-flags_test.yaml @@ -175,9 +175,9 @@ tests: - --registry=txt - --provider=aws - --extraArgA - - --no-extraArgB - --extraArgC - --no-extraArgD + - --no-extraArgB - it: should throw error when txtPrefix and txtSuffix are set set: diff --git a/charts/external-dns/values.yaml b/charts/external-dns/values.yaml index 7d0688ee51..46fbe8f7c7 100644 --- a/charts/external-dns/values.yaml +++ b/charts/external-dns/values.yaml @@ -304,26 +304,6 @@ provider: # @schema type: [object, string] metricRelabelings: [] relabelings: [] - -# Example array: -# ```yaml -# extraArgs: -# - --zone-id-filter=/hostedzone/Z00001 -# - --zone-id-filter=/hostedzone/Z00002 -# - --zone-id-filter=/hostedzone/Z00003 -# ``` -# -# Eample map: (supported values for map are strings, list of strings, and boolean) -# ```yaml -# extraArgs: -# extraArgA: valueA -# extraArgB: -# - valueB-1 -# - valueB-2 -# extraArgC: true -# extraArgD: false -# ``` - # -- Extra arguments to provide to _ExternalDNS_. # An array or map can be used, with maps allowing for value overrides; maps also support slice values to use the same arg multiple times. extraArgs: {} # @schema type: [array, null, object]; item: string; uniqueItems: true