36 Commits

Author SHA1 Message Date
System-Arch
066a11e215
feat(source/gateway-api)!: migrate Gateway and HTTPRoute to v1 (#6291)
* source/gateway-api: Migrate Gateway and HTTPRoute from v1beta1 to v1

This migrates the Kubernetes API interactions for Gateway and HTTPRoute
objects from v1beta1 to v1.

The v1beta1 revert was originally made in PR #4610 (July 2024) because
GKE clusters were not yet serving v1 CRDs. That is no longer the case:
v1 Gateway and HTTPRoute have been available since Gateway API v1.0.0
(October 2023) and all major managed Kubernetes providers now serve them.

This change does NOT modify TLSRoute, TCPRoute, or UDPRoute, which
remain at v1alpha2. TLSRoute's migration to v1 depends on Gateway API
v1.5.0+ and is tracked separately in #6247.

* Updated Gateway API "Supported API Versions" section.

* Document minimum supported Gateway API CRD version

Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>

* Merge branch 'master' into gateway-api-v1

* Revised "Supported API Versions" Gateway API doc.

Incorporated review suggestions from @mloiseleur

* Removed extraneous empty links in import blocks

---------

Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
2026-04-06 17:47:30 +05:30
vflaux
c745bb044a
chore(go): upgrade to go1.26 (#6314)
* chore(go): upgrade to go1.26

* chore: use the new new() capability

* chore(lint): update golanci-lint

* chore(endpoint): add EndpointKey.String() test
2026-03-29 23:12:12 +05:30
vflaux
fd89065e0a
fix(lint): remove govet exclusion from tests (#6315) 2026-03-27 20:00:49 +05:30
Ivan Ka
d217706973
refactor(fqdn): encapsulate FQDN template logic into TemplateEngine (#6292)
* refactor(source): extract FQDN template logic into fqdn.TemplateEngine

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

* refactor(source): extract FQDN template logic into fqdn.TemplateEngine

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

* refactor(source): extract FQDN template logic into fqdn.TemplateEngine

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

* refactor(source): extract FQDN template logic into fqdn.TemplateEngine

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

* refactor(source): extract FQDN template logic into fqdn.TemplateEngine

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

* refactor(source): extract FQDN template logic into fqdn.TemplateEngine

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

* refactor(source): extract FQDN template logic into fqdn.TemplateEngine

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

* refactor(source): extract FQDN template logic into fqdn.TemplateEngine

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

* refactor(source): extract FQDN template logic into fqdn.TemplateEngine

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

* refactor(source): extract FQDN template logic into fqdn.TemplateEngine

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

* refactor(source): extract FQDN template logic into fqdn.TemplateEngine

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

* refactor(source): extract FQDN template logic into fqdn.TemplateEngine

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

* refactor(fqdn): encapsulate FQDN template logic into TemplateEngine

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

* refactor(fqdn): encapsulate FQDN template logic into TemplateEngine

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

* efactor(fqdn): encapsulate FQDN template logic into TemplateEngine

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

* refactor(fqdn): encapsulate FQDN template logic into TemplateEngine

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

* refactor(fqdn): encapsulate FQDN template logic into TemplateEngine

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

* refactor(fqdn): encapsulate FQDN template logic into TemplateEngine

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

* refactor(fqdn): encapsulate FQDN template logic into TemplateEngine

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

* refactor(fqdn): encapsulate FQDN template logic into TemplateEngine

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

* refactor(fqdn): encapsulate FQDN template logic into TemplateEngine

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

* refactor(fqdn): encapsulate FQDN template logic into TemplateEngine

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2026-03-23 19:40:19 +05:30
Ivan Ka
e1aee5dc00
refactor(wrappers): introduce wrapper.Build as single entry point for source pipeline (#6300)
* refactor(wrappers): introduce BuildWrappedSource as single entry point for source pipeline

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

* refactor(wrappers): introduce BuildWrappedSource as single entry point for source pipeline

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

* refactor(wrappers): introduce BuildWrappedSource as single entry point for source pipeline

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

* refactor(wrappers): introduce wrapper.Build as single entry point for source pipeline

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2026-03-22 15:58:13 +05:30
Ivan Ka
2c8b57eea4
refactor(test): deduplicate endpoint assertion helpers across source (#6299)
* refactor(test): deduplicate endpoint assertion helpers across source and integration tests

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

* refactor(test): deduplicate endpoint assertion helpers across source

Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
2026-03-22 00:56:13 +05:30
Kai Udo
9c91c6ff71
refactor(testutils): extract log test helpers into subpackage to fix (#6236)
circular import

Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>
2026-03-01 14:56:11 +05:30
Ivan Ka
a929ad6cc6
chore(linter): enable unparam (#6160)
* chore(linter): enable unparam

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

* chore(linter): enable unparam

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

* chore(linter): enable unparam

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

* chore(linter): enable unparam

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

* chore(linter): enable unparam

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

* chore(linter): enable unparam

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

* chore(linter): enable unparam

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

* chore(linter): enable unparam

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

* chore(linter): enable unparam

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>
2026-02-20 15:15:39 +05:30
Ivan Ka
b304dfe37d
chore(linter): unused params and functions linter (#6142)
* chore(linter): enable unused

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

* chore(linter): enable unusedparam

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

* chore(linter): enable unusedparam

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

* chore(linter): enable unusedparam

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

* chore(linter): enable unusedparam

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

* chore(linter): enable unusedparam

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

* chore(linter): enable unusedparam

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

* chore(linter): enable unusedparam

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

* chore(linter): enable unusedparam

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

* chore(linter): enable unusedparam

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>
2026-01-31 23:20:24 +05:30
bogdankrasko
fd70df92ab
feat(source): gateway api hostname source annotation (#5959)
* feat: Add gateway api source annotation

* fix: Fix unit tests

* Update docs/annotations/annotations.md

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

* fix: validate gateway-hostname-source and warn on invalid

* fix: Fix formating

---------

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>
2026-01-11 23:36:03 +05:30
Ivan Ka
2bdb8df7e2
refactor(source): handle context in similar way (#6049)
* chore(source): sources to handle context in similar way

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

* chore(source): sources to handle context in similar way

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

* chore(source): sources to handle context in similar way

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-12-30 16:28:34 +05:30
dongjiang
fa1de21122
fix typo (#6011)
Signed-off-by: jiangdong <jiangdong@iflytek.com>
2025-12-10 09:03:34 -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
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