24 Commits

Author SHA1 Message Date
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
Michel Loiseleur
7fb0ed0857
revert: fix on gateway-api that ensure to use only latest generation with HTTPRoutes (#5490) 2025-06-04 00:56:38 -07:00
ivan katliarchuk
11fd3a87aa
chore(codebase): enable copyloopvar 2025-05-20 09:37:39 +01:00
ivan katliarchuk
fe83c0d2d0
chore(source): code cleanup 2025-05-12 14:21:28 +01:00
Ivan Ka
de6fb9d385
fix(log testing): re-use logger library testing functionality (#5368)
* fix(log testing): re-use logger library testing functionality

* fix(log testing): re-use logger library testing functionality

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

* fix(log testing): re-use logger library testing functionality

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-05-12 01:49:15 -07:00
Tyler Holinka
57ba99094d
fix: add unit test for route never being accepted 2025-05-04 14:28:15 -05:00
Jordan Jones
0dcd6c922c
chore: move into pre-existing conditions check 2025-05-03 11:42:21 -07:00
Tyler Holinka
1ad804caea
fix: add unit tests for generation check 2025-05-03 05:11:04 -05:00
ivan katliarchuk
9f427e5622
chore(source): code cleanup 2025-04-16 13:50:04 +01:00
ivan katliarchuk
b7879ccbd2
fix(log testing): fix logs
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-04-11 08:48:41 +01:00
David Winiarski
94278ae67c
update all route tests to have a valid spec.parentRef entry 2025-04-09 05:52:04 -06:00
Steven Kreitzer
724b86b8b8
feat(source): fitler by gateway name (#5160)
* feat: filter by gateway name

Signed-off-by: Steven Kreitzer <skre@skre.me>

* address comments

* address comments

* address comments

---------

Signed-off-by: Steven Kreitzer <skre@skre.me>
2025-03-12 01:51:47 -07:00
Alex Coomans
e6d03edd68
fix(source): debug log on gateway target detection
This code referenced the endpoints variable which was updated with each
resource leading to confusing debug messages - this sets up a new array
each iteration to log just the records from the relevant Gateway resource.
2025-02-18 13:31:57 -06:00
Andy Bursavich
29f1f3a19d source/gateway-api: revert v1.HTTPRoute to v1beta1.HTTPRoute 2024-07-14 09:06:35 -07:00
Andy Bursavich
0100b6637a source/gateway-api: revert v1.Gateway to v1beta1.Gateway 2024-07-14 09:06:35 -07:00
Andy Bursavich
5da9393b58 gateway-api: upgrade from v0.7.1 to v1.0.0 2023-12-18 16:35:07 -08:00
Christopher Larivière
6d78df4388
add initial support for gw apis 1.0.0 GA
Signed-off-by: Christopher Larivière <lariviere.c@gmail.com>
2023-11-06 09:32:31 -05:00
Fredrik Larsson
f8ae66efab Remove unnecessary test 2023-07-06 11:35:35 +02:00
Fredrik Larsson
76f8fbddcd Add tests for annotation override (gateway sources) 2023-07-05 09:52:26 +02:00
Andy Bursavich
b0dc1739aa gateway-api: switch to v1beta1 apis where available 2022-09-21 09:01:30 -07:00
Andy Bursavich
a7a56b9380 gateway-api: upgrade from v0.4.3 to v0.5.0 2022-09-21 09:01:30 -07:00
Andy Bursavich
74ffff6c26 gofumpt 2022-09-20 20:48:57 -07:00
Andy Bursavich
4371589a14 gateway: enforce listener matching 2022-02-24 21:33:53 -08:00
Andy Bursavich
3a1d86be20 gateway-httproute: add source 2022-02-24 21:30:10 -08:00