Commit Graph

85 Commits

Author SHA1 Message Date
Pascal Bachor
48959eb41a Merge remote-tracking branch 'upstream/master' into provider 2025-07-29 14:47:28 +02:00
Pascal Bachor
80058873e4 fix: linter 2025-07-29 14:46:30 +02: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
Pascal Bachor
177a418b09 refactor: Use list of pairs instead of pair of lists in update changes 2025-07-23 17:55:56 +02: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
Kim Sondrup
6a682b0f5b
feat: Plan normalizeDNSName convert Unicode to ASCII (#5049) 2025-06-10 09:14:25 -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
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
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
Pascal Bourdier
32e55eaf16 fix: remove CompareBoolean func
CompareBoolean() is no more used now

cf: 5affab0561
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
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
1bd3834743
handle missing TXT records with a forcedUpdate strategy
This change tries to remove part of the logic added in 50f196c0db.
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
Thibault Jamet
17fb8813d0
Reduce AWS Route53 API calls
Currently, planning instructs to create all records even
those which does not match any zone.
Later, those records will be checked towards the existing
records and filtered whether they match or not a hosted zone.

This causes a problem, at least in the specific case of the Route53
implementation as it always calls the ApplyChanges method, which in its
turn always retrieves all records in all zones.

This causes high pressure on Route53 APIs, for non-necessary actions.

By being able to filter all unmanaged records from the plan, we can
prevent from calling ApplyChanges when nothing has to be done and hence
prevent an unnecessary listing of records.

By doing so, the rate of API calls to AWS Route53 is expected to be
reduced by 2
2021-04-25 18:10:36 +02:00
Raffaele Di Fazio
daeee26684
Add flag to opt in for NS records management (#1915)
* adds flag to opt in for NS records management

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* go fmt

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* goimports

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* fix more tests

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* go fmt again

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* fix test

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* more tests

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* make ordering of managed records consistent

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* fix flag

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>
2021-01-12 06:32:26 -08:00
Raffaele Di Fazio
f5aa1c4c37
Add new method to provider interface to implement provider specific changes (#1868)
* adds tests for shouldUpdateProviderSpecific

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* move AWS health to where it belongs

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* add test that breaks things

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* adds adjustendpoints method

Signed-off-by: Raffaele Di Fazio <raffo@github.com>

* fix controller

Signed-off-by: Raffaele Di Fazio <raffo@github.com>

* actually pass the provider where needed

Signed-off-by: Raffaele Di Fazio <raffo@github.com>

* OMG goland do your go fmt thing

Signed-off-by: Raffaele Di Fazio <raffo@github.com>

* use registry as proxy

Signed-off-by: Raffaele Di Fazio <raffo@github.com>

* make linter happy

Signed-off-by: Raffaele Di Fazio <raffo@github.com>

* change AdjustEndpoints signature

Signed-off-by: Raffaele Di Fazio <raffo@github.com>

* fix typo

Signed-off-by: Raffaele Di Fazio <raffo@github.com>

* actually use adjusted endpoints

Signed-off-by: Raffaele Di Fazio <raffo@github.com>

* revert cloudflare change

Signed-off-by: Raffaele Di Fazio <raffo@github.com>

* Update provider/cloudflare/cloudflare.go

Co-authored-by: Nick Jüttner <nick@juni.io>

Co-authored-by: Nick Jüttner <nick@juni.io>
2020-12-09 23:40:54 -08:00
Yury Tsarev
904d8e4c87 NS record support 2020-10-12 20:23:17 +02:00
Adam Stankiewicz
e8f301ec35 Remove unnecessary import 2020-06-01 10:26:12 +02:00
Adam Stankiewicz
d6bb3ef82c
Update plan/plan.go
Co-authored-by: Raffaele Di Fazio <raffo@github.com>
2020-05-31 20:07:43 +02:00
Adam Stankiewicz
5bb3b7da20
Update plan/plan.go
Co-authored-by: Raffaele Di Fazio <raffo@github.com>
2020-05-31 20:07:34 +02:00
Adam Stankiewicz
98b26d73dd Apply fixes for custom comparators 2020-05-30 18:34:54 +02:00
Adam Stankiewicz
f008e894df Allow for custom property comparators
Fixes issue #1463

Co-authored-by: Alastair Houghton <alastair@alastairs-place.net>
2020-05-12 16:27:46 +02:00
Markus Cisler
14d64e09f2 Change DomainFilter to apply to records as well
This moves `domain_filter.go` to the `endpoint` package to make it
possible to filter and exclude record names in
`plan.filterRecordsForPlan()` so it does not have to be implemented in
every single provider.

Because some providers access `DomainFilter.filters` directly it had to
be exported.
2020-02-24 11:19:45 +01:00
Tariq Ibrahim
41ba7f1ff5
rename project root package to sigs.k8s.io 2020-01-06 08:08:35 -08:00
Nick Jüttner
9418e3acd8
Merge pull request #1008 from devkid/feature/aws-routing-policies
[RFC] Add support for all AWS Route53 routing policies; add additional Setldentifier abstraction layer
2019-11-19 11:21:12 +01:00
Nick Jüttner
f763d2a413 Move into kubernetes-sigs organization (#1245)
* Move into kubernetes-sigs organization

* Disable labeler action for forks
2019-11-01 17:10:19 +01:00