1481 Commits

Author SHA1 Message Date
Kai Udo
c0b0e4b0a0
refactor(aws): extract and restructure alias-handling logic to enable safe upcoming fixes (#6021)
* test: add regression test to ensure behavior before refactor

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>

* refactor aws adjustEndpointAndAaaaIfNeeded

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>

* test(aws): add comprehensive tests and remove old logic

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>

* refactor(aws): simplify AdjustEndpoints record-type dispatch

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>

---------

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>
2026-01-27 00:17:50 +05:30
Ivan Ka
7579ce231c
feat(pihole): deprecate v5 API support (#6123)
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2026-01-25 14:44:20 +05:30
vflaux
ee87a9a991
chore(cloudflare): move custom hostnames logic to dedicated files (#6114)
Also fix casing for some variable and function names.
2026-01-25 14:44:13 +05:30
Ivan Ka
1756cdd5d1
chore(provider): zone cache provider interface (#6120)
* chore(provider): zone cache provider interface

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(provider): zone cache provider interface

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(provider): zone cache provider interface

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(provider): zone cache provider interface

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(provider): zone cache provider interface

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(provider): zone cache provider interface

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(provider): zone cache provider interface

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(provider): zone cache provider interface

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2026-01-25 14:32:13 +05:30
Romain Beuque
0eadcb0ef9
fix: provider/FindZone: transform zone name to unicode as well (#5980)
Signed-off-by: Romain Beuque <556072+rbeuque74@users.noreply.github.com>
2026-01-17 15:37:08 +05:30
Andy Hay
3dd839a33e
chore(cloudflare): migrate customhostname to v5 (#5891)
* chore(cloudflare): migrate customhostname to v5

* style: use range instead of loop

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

* style: remove extra space

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

* style: spelling

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

* test(cloudflare): restore missing tests dropped during merge

* style: use t.Context() and t.Parallel() in restored tests

* refactor(cloudflare): split submitCustomHostnameChanges to reduce complexity

* style: apply gofmt to restored tests

* test: restore valid tests from master and append custom ones

* fix(cloudflare): migrate tests to v5 SDK error types and fix PerPage handling

- Replace all cloudflarev0.Error usages with cloudflare.Error in tests
- Remove unused cloudflarev0 import
- Fix getDNSRecordsMap to use PerPage configuration
- Add early return in convertCloudflareError for structured v5 errors
- Update TestConvertCloudflareError to handle v5 error types safely
- Remove ErrorCodes field from error structs (not in v5 SDK)

Signed-off-by: Andrew Hay <andrew.hay@benchmarkanalytics.com>

* style(cloudflare): apply gofmt formatting

Signed-off-by: Andrew Hay <andrew.hay@benchmarkanalytics.com>

* Update provider/cloudflare/cloudflare_test.go

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

* test: add to test

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

* fix: change context

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

* style: use short variable declaration operator instead of var

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

* refactor(cloudflare): address PR review feedback

- Remove SDK migration status section from cloudflare.md (per vflaux and ivankatliarchuk)
- Add newCloudflareError() helper for proper v5 SDK error testing
- Move ExampleDomain, TestGroupByNameAndTypeWithCustomHostnames_MX, and
  TestProviderPropertiesIdempotency back to original locations to minimize diff

* test: add customhostname test

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

* refactor: make CustomHostname types package-internal

* style: fix gofmt formatting

* Update .gitignore

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

---------

Signed-off-by: Andrew Hay <andrew.hay@benchmarkanalytics.com>
Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>
2026-01-15 01:59:37 +05:30
Saurav Upadhyay
ced397285b
test(provider/exoscale): improved the test coverage for exoscale provider from 62.8% to 80.4% (#6112)
* test(provider/exoscale): improve test coverage from 62.8 to 80.4%

* Revert "test(provider/exoscale): improve test coverage from 62.8 to 80.4%"

This reverts commit 56aa8b1dc87bc45f49fb247213d26f8883969865.

* test(provider/exoscale): improve test coverage from 62.8 to 80.4%
2026-01-14 13:25:37 +05:30
Jan Jansen
63296f5234
feat(coredns): rename ownerId and ownedBy to owner (#6032)
Signed-off-by: Jan Jansen <jan.jansen@gdata.de>
2026-01-11 01:17:56 +05:30
Kai Udo
27f9199792
refactor(aws): abstract provider-specific boolean parsing (#6078)
* refactor(endpoint): add GetBoolProviderSpecificProperty method with comprehensive tests

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>

* refactor(endpoint): add GetBoolProviderSpecificProperty method and update consumers

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>

* fix(lint): remove named returns in GetBoolProviderSpecificProperty

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>

---------

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>
2026-01-11 00:55:56 +05:30
Kai Udo
d78dfb6ae1
fix(aws): enable AWS API validation for routing policies without setIdentifier (#6082)
Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>
2026-01-08 13:31:47 +05:30
vflaux
b2390a9187
chore(lint): replace with NewSoftErrorf when possible (#6061) 2025-12-30 15:48:34 +05:30
Ivan Ka
07dd842432
test(coverage): improve code coverage for different files (#6045)
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-12-27 22:04:40 +05:30
Ivan Ka
a23f2d5a9a
chore(lint): configure modernize linter (#6035)
* chore(lint): configure modernize linter

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(lint): configure modernize linter

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(lint): modernize linter

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* chore(lint): configure modernize linter

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-12-27 22:04:33 +05:30
alexbakker-quandago
cab76d250d
feat(aws): enable support for NAPTR records (#6022)
Since ef62107, it is now possible to enable support for NAPTR records in
the AWS provider. This patch does so and adds some tests for it.

Co-authored-by: woltere <wolter.eldering@quandago.com>
2025-12-21 08:28:30 -08:00
Rodrigo Kellermann
bf8bc46a3f
fix(cloudflare): dns records pagination (#5986)
* fix: cloudflare dns records pagination

Signed-off-by: Rodrigo Kellermann <kellermann@gmail.com>

* fix tests

Signed-off-by: Rodrigo Kellermann <kellermann@gmail.com>

* fix missing test condition

Signed-off-by: Rodrigo Kellermann <kellermann@gmail.com>

---------

Signed-off-by: Rodrigo Kellermann <kellermann@gmail.com>
2025-12-12 00:26:12 -08:00
blsho
6703e3aaeb
fix(pdns): ensure trailing dot for NS records (#5992)
* fix(pdns): ensure trailing dot for NS records

* Fix formatting test typos, make trailing types to list, refer to types with const

* Simplify trailing dot condition

* Move trailing types comment to correct location
2025-12-09 07:47:30 -08:00
Till Hoffmann
222b95fdca
fix(docs): Fixing typos in docs and comments (#5995) 2025-12-05 11:16:57 -08:00
Jan Jansen
8085ce246d
feat(coredns): use txt-owner-id to strictly separated external-dns instances (#5921)
* feat(coredns): use managed-by to separate records

Signed-off-by: Jan Jansen <jan.jansen@gdata.de>

* feat(coredns): use txt-owner-id to strictly separated external-dns instances

Signed-off-by: Jan Jansen <jan.jansen@gdata.de>

* fix tests

Signed-off-by: Jan Jansen <jan.jansen@gdata.de>

* fix reviewer comments

Signed-off-by: Jan Jansen <jan.jansen@gdata.de>

* answer review comments

* fix deletion behavior and remove extra function

* fix markdown

* fix tests again

---------

Signed-off-by: Jan Jansen <jan.jansen@gdata.de>
2025-12-02 00:48:25 -08:00
Aleksei Sviridkin
5a55b09f48
feat(annotations): add custom annotation prefix support for split horizon DNS (#5889)
* feat(annotations): add custom annotation prefix support for split horizon DNS

Add --annotation-prefix flag to allow customizing the annotation prefix
used by external-dns. This enables split horizon DNS scenarios where
multiple instances process different sets of annotations from the same
Kubernetes resources.

Changes:
- Add AnnotationPrefix field to Config with validation
- Convert annotation constants to variables that can be reconfigured
- Add SetAnnotationPrefix() function to rebuild annotation keys
- Integrate annotation prefix setting in controller startup
- Update Helm chart with annotationPrefix value
- Add comprehensive split horizon DNS documentation
- Update FAQ with annotation prefix examples

This maintains full backward compatibility - the default prefix remains
"external-dns.alpha.kubernetes.io/".

Co-Authored-By: Claude <noreply@anthropic.com>

* docs(advanced): fix markdown formatting in split-horizon guide

Add blank lines before code blocks to improve markdown rendering
and comply with markdownlint rules.

Co-Authored-By: Claude <noreply@anthropic.com>

* docs(advanced): fix markdown formatting in split-horizon guide

Co-Authored-By: Claude <noreply@anthropic.com>

* docs(charts): regenerate Helm chart documentation

Co-Authored-By: Claude <noreply@anthropic.com>

* test: add AnnotationPrefix field to test configs

Add missing AnnotationPrefix field to minimalConfig and overriddenConfig
test configurations to match the new default value set in NewConfig().

Co-Authored-By: Claude <noreply@anthropic.com>

* test(charts): update error pattern in json-schema test

Update expected error message pattern to match current Helm validation
output format.

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor(annotations): remove init() for explicit initialization

- Remove init() function from annotations package
- Add explicit SetAnnotationPrefix() call in controller/execute.go
- Remove annotation key aliases from source/source.go
- Replace all alias usages with annotations.* references (348 changes in 28 files)
- Add TestMain to existing test files (service_test.go, cloudflare_test.go)

This change makes annotation initialization explicit and predictable,
avoiding hidden global state initialization at import time.

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: update changelog and mkdocs to include annotationPrefix and split horizon DNS

Signed-off-by: Aleksei Sviridkin <f@lex.la>

* docs(split-horizon): fix linting

Signed-off-by: Aleksei Sviridkin <f@lex.la>

* refactor(annotations): replace hardcoded annotation prefix with constant

Replace all hardcoded "external-dns.alpha.kubernetes.io/" strings
with annotations.DefaultAnnotationPrefix constant to establish
a single source of truth.

Changes:
- Add DefaultAnnotationPrefix constant in source/annotations/annotations.go
- Replace hardcoded string in controller/execute.go with constant reference
- Replace hardcoded strings in pkg/apis/externaldns/types.go (2 occurrences)
- Add helm unit tests for annotationPrefix value

This eliminates string duplication and makes future changes easier.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Signed-off-by: Aleksei Sviridkin <f@lex.la>
Co-authored-by: Claude <noreply@anthropic.com>
2025-11-08 03:56:52 -08:00
Jan Jansen
8f34a87d18
feat(coredns): pass context to etcd client (#5915)
Signed-off-by: Jan Jansen <jan.jansen@gdata.de>
2025-10-24 01:07:35 -07:00
Edvin N
6e9d459d8d
fix: cloudflare softError failedZones (#5899)
Right now we get a fatal due to dual DNS records.
Instead do a softError and try again next reconcile.

Signed-off-by: Edvin Norling <edvin.norling@kognic.com>
2025-10-13 00:00:55 -07:00
vflaux
4ac0410d80
chore(cloudflare): migrate DeleteCustomHostname() to new lib (#5880) 2025-10-04 02:16:57 -07:00
Pascal Bourdier
699e994a9c
ci(linter): add go-critic (#5875)
* ci: add go-critic linter

follow go-critic advices when possible

* docs: add a short description about go-critic
2025-10-01 09:06:19 -07:00
Andrew Hay
e22ceab66f
refactor(pihole): reduce cyclomatic complexity of TestProviderV6 (#5876)
* refactor(pihole): reduce cyclomatic complexity of TestProviderV6

* chore(pihole): increase coverage

* style: linting

* style: linting

* fix: remove coverage html
2025-10-01 00:50:23 -07:00
Nikhil
92cf223b69
feat(provider/cloudflare): add support for tags (#5862)
* feat(provider/cloudflare): Add support for Cloudflare Tags

Signed-off-by: nikhil-m_neteinc <nikhil.m@netenrich.com>

* fix/reconcile the tags

* fix/reconcile the tags

* fix(lint): Address code formatting issues

Signed-off-by: nkhl99 <nkhlkumar01@gmail.com>

* test(provider/cloudflare): Add unit tests for tags feature

Signed-off-by: nkhl99 <nkhlkumar01@gmail.com>

* test(provider/cloudflare): Edited the unit cases

Signed-off-by: nkhl99 <nkhlkumar01@gmail.com>

* test(provider/cloudflare): Added the unit cases and created function for cloudflareTag

Signed-off-by: nkhl99 <nkhlkumar01@gmail.com>

* update(provider/cloudflare): Updated the cloudflare tutorial document with cloudflare-tags

Signed-off-by: nkhl99 <nkhlkumar01@gmail.com>

* update(provider/cloudflare): Updated the cloudflare tutorial document with cloudflare-tags

Signed-off-by: nkhl99 <nkhlkumar01@gmail.com>

* ci: Trigger CI checks

* update(provider/cloudflare): Updated the cloudflare tutorial document

Signed-off-by: nkhl99 <nkhlkumar01@gmail.com>

---------

Signed-off-by: nikhil-m_neteinc <nikhil.m@netenrich.com>
Signed-off-by: nkhl99 <nkhlkumar01@gmail.com>
2025-09-29 06:24:23 -07:00
Andrew Hay
c657f74ffc
refactor(pihole): reduce cyclomatic complexity of TestProvider (#5865)
* Refactor pihole tests to reduce cyclomatic complexity and preserve coverage

* refactor: split TestProvider into focused test functions to reduce cyclomatic complexity

- Split monolithic TestProvider into four focused test functions:
  - TestProvider_InitialState: tests empty provider state
  - TestProvider_CreateRecords: tests record creation
  - TestProvider_DeleteRecords: tests record deletion
  - TestProvider_UpdateRecords: tests record updates
- Each function tests a single scenario, reducing complexity
- Preserves all original test logic and maintains 89% coverage
- Passes cyclop linter with complexity threshold of 10
2025-09-25 10:06:20 -07:00
Kai Udo
fe753cb8e9
test(cloudflare): clear environment variables before setting test values (#5851)
* test(cloudflare): clear environment variables before setting test values

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>

* refactor(cloudflare): extract environment variable names to package constants

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>

* refactor(cloudflare): use testutils helper for test environment setup

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>

* refactor(cloudflare): simplify token handling and improve test env setup

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>

---------

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>
2025-09-22 05:10:17 -07:00
vflaux
f7793950cc
test(cloudflare): mock provider for cf change tests (#5852) 2025-09-20 02:26:13 -07:00
vflaux
69429a5e47
test(cloudflare): modernize zoneDomainFilter test (#5853) 2025-09-19 10:50:15 -07:00
Jan Jansen
8851544c1c
feat(coredns): add annotations for coredns groups (#5842)
Signed-off-by: Jan Jansen <jan.jansen@gdata.de>
2025-09-18 23:22:12 -07:00
vflaux
ad3d958e4a
fix(cloudflare): reconciliation loop with default comment (#5828) 2025-09-15 00:24:10 -07:00
vflaux
1c116507b7
chore(cloudflare): migrate UpdateDNSRecord() to new lib (#5781) 2025-09-09 02:57:32 -07:00
Rhys Davies
b8fee6a3d3
aws: add ap-southeast-6 region (#5812) 2025-09-07 09:25:25 -07:00
vflaux
7b2adbb0ec
chore(cloudflare): add unit tests for zoneService (#5800) 2025-09-04 15:49:15 -07:00
Andrew Hay
b095b3e560
chore(pihole): reduce cyclometic complexity (#5802) 2025-09-04 13:51:14 -07:00
vflaux
4aac6870f5
chore(cloudflare): migrate DeleteDNSRecord() to new lib (#5780) 2025-09-04 13:11:17 -07:00
vflaux
61ca17c0fb
chore(cloudflare): migrate ListRecords() to new lib (#5778)
* chore(cloudflare): migrate ListRecords() to new lib

* chore(cloudflare): test zoneService.ListDNSRecord()
2025-09-04 02:53:15 -07:00
Pascal Bachor
e88b94bdee
fix(coredns): debug message on labels update (#5789)
* coredns: fix debug message

* consistent spacing in debug message

Co-authored-by: Ivan Ka <5395690+ivankatliarchuk@users.noreply.github.com>

---------

Co-authored-by: Pascal Bachor <bachorp@users.noreply.github.com>
Co-authored-by: Ivan Ka <5395690+ivankatliarchuk@users.noreply.github.com>
2025-09-03 03:37:14 -07:00
vflaux
3861441eec
fix(cloudflare): unneeded records updates (#5770) 2025-09-01 09:41:13 -07:00
vflaux
e78b38597d
chore(cloudflare): migrate CreateDNSRecord() to new lib (#5779) 2025-08-30 03:07:09 -07:00
vflaux
5181b3f0d0
chore(cloudflare): migrate DNSRecord to new lib struct (#5762) 2025-08-28 06:05:18 -07:00
Anthony Chand
9e0acd0bd0
feat(azure): update Azure provider configuration and documentation (#5648)
* feat(azure): update Azure provider configuration and documentation

- Update Azure tutorial documentation
- Modify Azure provider config implementation

* fix formatting

* update text
2025-08-28 06:05:10 -07:00
vflaux
81290c03e6
chore(cloudflare): rename zoneService fields (#5761) 2025-08-24 04:03:06 -07:00
Ivan Ka
ccebff99e8
fix(http): concurrent map read/write (#5753)
* fix(http): concurrent map read/write

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* fix(http): concurrent map read/write

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* fix(http): concurrent map read/write

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* fix(http): concurrent map read/write

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* fix(http): concurrent map read/write

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-08-21 04:53:06 -07:00
Ivan Ka
b31afb430d
fix(source/wrappers/events): events not triggered (#5687)
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-08-16 02:49:07 -07:00
vflaux
ccb3e6bd2f
chore(cloudflare): upgrade library to v5 (#5734) 2025-08-14 02:23:09 -07:00
Matt Mix
6bda906b7f
fix(aws): Fix error when specifying AWS_CA_BUNDLE environment variable. (#5665) 2025-08-07 00:15:42 -07:00
Hiroki Hanada
498bb87623
fix: IDNA awareness in the zone finder (#5705)
Signed-off-by: Hiroki Hanada <hiroki-hanada@cybozu.co.jp>
2025-08-01 12:27:38 -07:00
Ivan Ka
0d1309c7fa
fix(endpoint): domains handling with idna (#5685)
* fix(idna): fix handling of domains

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* fix(idna): fix handling of domains

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* fix(idna): fix handling of domains

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-07-29 03:44:09 -07:00
Andrew Hay
23e12c1a09
refactor(cloudflare): use lib v4 for zone services (#5654)
* chore: update zone implementation to v4

* chore: update cloudflare zones to v4

* docs: newline around lists

* docs: styling

* style: remove trailing whitespace
2025-07-29 03:44:01 -07:00