108 Commits

Author SHA1 Message Date
Kai Udo
029df9457d
refactor: extract normalizeDNSName to idna package for reuse (#6043)
Signed-off-by: u-kai <76635578+u-kai@users.noreply.github.com>
2025-12-21 08:16:30 -08:00
Till Hoffmann
222b95fdca
fix(docs): Fixing typos in docs and comments (#5995) 2025-12-05 11:16:57 -08:00
vflaux
00e04e9fe5
refactor(plan): reduce Calculate() cyclomatic complexity (#5961) 2025-12-02 00:32:30 -08:00
troll-os
41b1154cdd
feat: add new flags to allow migration of OwnerID (#4823)
* Reintroduce base config for txt owner migration

# Conflicts:
#	controller/execute.go
#	registry/txt.go

# Conflicts:
#	pkg/apis/externaldns/types.go

* Added label update logic and fixed existing tests

* Fixed existing declaration in tests, re introduced tests for new flag, regened flags.md from make

* Fixed tests logic and target expression evaluation, fixed update of label in the TXT registry process

* Set Old owner id var down the plan to calculate changes correctly

* Lint fixes

* (wip) Code cleaning and test coverage

* Simplified label overwriting on migration and implem tests for coverage

* Fix tests

* Update txt registry doc

* Fix rebase issues in txt test

* Update docs/registry/txt.md

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

* Update docs/registry/txt.md

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

* Update docs/registry/txt.md

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

* Fix label overriding in TXT record generation when migration is enabled

* Make linter happy

* Regen flags, fix types tests after types updates

* Removed boolean flag that enabled migration, evaluate only against old owner flag instead

---------

Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
2025-09-29 01:20:19 -07:00
Ivan Ka
e9983a5726
feat(events): raise k8s events with fake provider (#5659)
* feat(events): publish k8s events

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

* feat(events): publish k8s events

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

* feat(events): publish k8s events

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

* feat(events): publish k8s events

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

* feat(events): publish k8s events

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

* feat(events): raise k8s events with fake provider

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

* feat(events): raise k8s events with fake provider

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

* feat(events): raise k8s events with fake provider

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

* feat(events): raise k8s events with fake provider

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

* feat(events): raise k8s events with fake provider

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

* feat(events): raise k8s events with fake provider

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

* feat(events): raise k8s events with fake provide

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

* feat(events): raise k8s events with fake provider

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

* feat(events): raise k8s events with fake provider

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
2025-08-20 00:37:07 -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
Ivan Ka
a336ee0d96
chore(plan): added tests for cases with asterisks (#5640)
* chore(plan): added tests for cases with asterisks

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

* chore(plan): added tests for cases with asterisks

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-07-11 08:47:28 -07:00
Michel Loiseleur
fc4a2cb6ac
chore(ci): update labels automation (#5580) 2025-07-03 08:45:26 -07:00
Sandor Szücs
93c76553e7
refactor: use slices.Contains instead of handrolled for loop (#5589)
Signed-off-by: Sandor Szuecs <sandor.szuecs@zalando.de>
2025-06-29 13:26:37 -07:00
Sandor Szücs
56cca87163
fix: reduce warning by using idna profile (#5587)
fixes https://github.com/kubernetes-sigs/external-dns/issues/5581, tested by running test with -v and added println("warn") to the log warning path

Signed-off-by: Sandor Szuecs <sandor.szuecs@zalando.de>
2025-06-29 13:02:34 -07:00
Ivan Ka
d30674b650
chore(codebase): enable linter recvcheck (#5522)
* chore(codebase): enable linter recvcheck

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

* chore(codebase): enable linter recvcheck

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

* chore(codebase): enable linter recvcheck

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-06-22 03:22:59 -07:00
kaikai
a4522f0b76
chore(domainfilter): use pointer receivers for DomainFilter (#5546)
* refactor(domainfilter): use pointer receivers for DomainFilter

* refactor(domainfilter): complete pointer type consistency across providers
2025-06-21 00:38:53 -07:00
Kim Sondrup
6a682b0f5b
feat: Plan normalizeDNSName convert Unicode to ASCII (#5049) 2025-06-10 09:14:25 -07:00
Ivan Ka
bdb51b2d96
chore(codebase): enable testifylint (#5441)
* chore(codebase): enable testifylint

* chore(codebase): enable testifylint

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

* chore(codebase): enable testifylint

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-05-21 03:46:34 -07:00
Ivan Ka
923a6d95c0
fix(webhook): api json object plan.Changes case (#5355)
* fix(webhook): api case

* fix(webhook): api case

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-05-07 13:21:16 -07:00
Michel Loiseleur
3c93bcb076
chore(code): improve some tests + re-order sources flags CLI (#5288)
* fix(plan): always use managed records

* robust random port in test

* use defaultconfig for managed-record-types

* be explicit about static variable

* fix wait

* re-order flags related to sources + dynamic managedrecordtype help

* fix flag doc
2025-04-27 14:11:24 -07:00
ivan katliarchuk
abdf8bbc02
chore(refactore): added lint checks
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-04-23 08:22:43 +01:00
Dennis Haney
2c19f59cf5
fix: lint 2024-10-30 19:52:03 +07:00
Dennis Haney
4238316c47
fix: indentation 2024-10-30 19:45:28 +07:00
Dennis Haney
5888e85493
Update plan/plan.go
Co-authored-by: Raffaele Di Fazio <raffo@github.com>
2024-10-30 18:37:42 +07:00
Dennis Haney
4fa1dc87fa
fix: missing namespace 2024-10-18 09:20:29 +02:00
Dennis Haney
45e9ed9a3f
feat: log when endpoint ignored due to ownerid not match 2024-10-17 08:25:40 +02:00
Kubernetes Prow Robot
03a2c66971
Merge pull request #4296 from leonardocaylent/bugfix/group-endpoints-per-hosted-zone-for-aws
fix: duplicated endpoint per hosted zone
2024-05-10 01:01:41 -07:00
Leonardo Quatrocchi
64d0833303 Final fix for error on delete 2024-04-22 20:45:28 -03:00
Leonardo Quatrocchi
d9b743922a Specify and clarify root cause of issue 4241 2024-04-06 03:25:05 -03:00
Leonardo Quatrocchi
4fb2f2e283 Specific bugfix near the root cause for duplicated deletes on plan.go 2024-04-05 01:29:38 -03:00
Sandor Szücs
99626eedd1
test: #4059 detect no change necessary with provider specific config
Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
2024-01-17 17:06:39 +01:00
Pascal Bourdier
32e55eaf16 fix: remove CompareBoolean func
CompareBoolean() is no more used now

cf: 5affab056180762e2045a7b96f335e254d14d3d7
2023-12-16 15:18:17 +01:00
John Gardiner Myers
94713c20c6 Add --exclude-record-types flag 2023-09-15 18:45:09 -07:00
Kubernetes Prow Robot
030342f445
Merge pull request #3747 from cronik/bugfix/dual-stack-records
Fix planning for multi-cluster dual stack record types
2023-09-14 22:24:12 -07:00
Kyle Cronin
55ae13ef21 Plan record type conflict should prefer A and AAAA records
endpoint.Targets.Less gives priority to A and AAAA over CNAME records so the
plan record type conflict resolver should also prefer A/AAAA.
2023-09-03 15:58:27 -04:00
Kubernetes Prow Robot
0a6574a982
Merge pull request #3860 from johngmyers/refactor
Remove DomainFilterInterface
2023-09-01 07:54:50 -07:00
Kyle Cronin
cf756a76b2 Extract record types conflict resolver 2023-08-29 23:41:46 -04:00
Kyle Cronin
20bff0aae5 Remove EndpointFilterInterface 2023-08-16 23:48:30 -04:00
Kyle Cronin
635da46f70 Remove unused validateOwner plan test function 2023-08-15 19:37:50 -04:00
Kyle Cronin
59054b02d8 Fix planning for multi-cluster dual stack record types
When AAAA multi-target / dual stack support was
added via #2461 it broke ownership of domains across
different clusters with different ingress records types.

For example if 2 clusters manage the same zone,
1 cluster uses A records and the other uses CNAME
records, when each record type is treated as a separate
planning record, it will cause ownership to bounce back
and forth and records to be constantly created and
deleted.

This change updates the planner to keep track of multiple
current records for a domain. This allows for A and AAAA
records to exist for a domain while allowing record type
changes.

The planner will ignore desired records for a domain that
represent conflicting record types allowed by RFC 1034 3.6.2.
For example if the desired records for a domain contains
a CNAME record plus any other record type no changes for
that domain will be planned.

The planner now contains an owned record filter provided
by the registry. This allows the planner to accurately plan
create updates when there are record type changes between
the current and desired endpoints. Without this filter the
planner could add create changes for domains not owned
by the controller.
2023-08-15 19:37:50 -04:00
Kyle Cronin
7fb144d8d8 Fix planning for multi-cluster dual stack record types
When AAAA multi-target / dual stack support was
added via #2461 it broke ownership of domains across
different clusters with different ingress records types.

For example if 2 clusters manage the same zone,
1 cluster uses A records and the other uses CNAME
records, when each record type is treated as a separate
planning record, it will cause ownership to bounce back
and forth and records to be constantly created and
deleted.

This change updates the planner to keep track of multiple
current records for a domain. This allows for A and AAAA
records to exist for a domain while allowing record type
changes.

The planner will ignore desired records for a domain that
represent conflicting record types allowed by RFC 1034 3.6.2.
For example if the desired records for a domain contains
a CNAME record plus any other record type no changes for
that domain will be planned.

The planner now contains an owned record filter provided
by the registry. This allows the planner to accurately plan
create updates when there are record type changes between
the current and desired endpoints. Without this filter the
planner could add create changes for domains not owned
by the controller.
2023-08-15 19:37:50 -04:00
John Gardiner Myers
5339c0c72c Fix reconciliation of provider-specific properties 2023-08-11 20:53:26 -07:00
John Gardiner Myers
e9be5887bd Remove DomainFilterInterface 2023-08-11 13:01:22 -07:00
John Gardiner Myers
5affab0561 Remove PropertyValuesEqual method from Provider interface 2023-08-04 04:56:43 -07:00
Matias Charriere
df5e9aeace
remove ForceUpdate property on endpoint after reimplementation
Signed-off-by: Matias Charriere <matias@giantswarm.io>
2023-06-15 11:50:05 +02:00
Matias Charriere
ed49e67c00
update planner tests to match forced update strategy
Signed-off-by: Matias Charriere <matias@giantswarm.io>
2023-06-15 11:50:05 +02:00
Matias Charriere
1bd3834743
handle missing TXT records with a forcedUpdate strategy
This change tries to remove part of the logic added in 50f196c0db280de7a9b55a8f7fd6b0a607ac5472.
The forceUpdate strategy relies on existing code of the planner to migrate TXT records to the new format,
being the main goal to avoid conflicts during apply.

Signed-off-by: Matias Charriere <matias@giantswarm.io>
2023-06-15 11:50:04 +02:00
John Gardiner Myers
ba26db45ce Simplify planner's data structure 2023-04-13 19:28:54 -07:00
John Gardiner Myers
94d09b37dc Separate plan by record type 2023-03-30 17:47:59 -07:00
Raffaele Di Fazio
82a554e775
Revert "fix: New provider specific update" 2022-11-29 10:05:26 +01:00
Gustavo Veloso
ca07f0a8ca New provider-specific properties support when updating DNS records
shouldUpdateProviderSpecific seems to be iterating over just the current properties that were previously set, not taking into consideration for planning changes when additional ProviderSpecific properties were just set.

The previous code version only iterates over current ProviderSpecific properties. This new version iterates over desired properties, including those that were just set.
2022-11-21 19:42:39 -03:00
Andy Bursavich
74ffff6c26 gofumpt 2022-09-20 20:48:57 -07:00
Andrey Lebedev
50f196c0db Handle the migration to the new TXT format: create missing records 2022-07-13 21:49:27 +02:00
Will Hegedus
0c8f6a69bd feat!: handle IP address comparison
Previously there was no distinction between an IP address and any other string
when doing a comparison to determine which is "less" when determining which endpoint to actually create.

This explicitly handles IP addresses and will always prefer
them over non-IP addresses when determining which of two targets is less.
2022-04-20 13:35:28 -04:00