Commit Graph

64 Commits

Author SHA1 Message Date
Pascal Bachor
4e18b4b60e refactor: Use list of pairs instead of pair of lists in update changes (adjust use sites) 2025-07-23 19:30:51 +02: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
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
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
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
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
John Gardiner Myers
94d09b37dc Separate plan by record type 2023-03-30 17:47:59 -07: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
Rob Selway
469f07eb8b Merge branch 'master' into fix-1906 2021-02-14 14:29:01 +00:00
Rob Selway
091b8a8f82 Plan test for ignoring case when comparing targets 2021-02-14 13:41:38 +00: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
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
Alfred Krohmer
6681a3a358 Add support for all AWS Route53 routing policies; add additional SetIdentifier abstraction layer
This adds support for all AWS Route53 routing policies, namely:
* simple (default)
* weighted
* latency
* failover
* geolocation
* multi value answer

These routing policies allow to create multiple records with the same
name, but different "SetIdentifiers". Therefor, as a prerequisite for
implementing support for above routing policies, there is a new
"abstraction layer" added that handles this SetIdentifier by adding a
new attribute in the Endpoint struct and adding another level in the
plan table.
2019-09-10 20:47:36 +02:00
Nick Jüttner
6d39526069
Merge branch 'master' into cloudflare-proxied-annotation 2019-01-24 11:16:54 +01:00
Erik Swets
a5441bddea Support updating ProviderSpecific property. 2019-01-11 20:15:54 +01:00
Justin SB
173ef2ea4b Normalize DNS names during planning
Ensure that we don't consider names with and without a trailing dot
differently at this stage.
2018-12-27 12:41:13 -05:00
Martin Linkhorst
b5b8d618e9
Merge branch 'master' into txtRecordHandling 2018-07-23 13:52:22 +02:00
Nick Jüttner
54f5431ef0 chore 2018-06-20 17:41:03 +02:00
Nick Jüttner
86072511c9 Removing the regex 2018-06-11 11:18:50 +02:00
Nick Jüttner
6391ddb92a Removing the regex 2018-06-08 17:49:01 +02:00
Nick Jüttner
531d465c24 Adding more test records 2018-06-07 13:52:46 +02:00
Nick Jüttner
7a759bd8df Referencing to RFC and add more unit tests
Signed-off-by: Nick Jüttner <nick@juni.io>
2018-06-04 13:40:11 +02:00
John Chadwick
522107696d Add failing test for TXT record planning (#580) 2018-06-01 09:08:17 -04:00
Nick Jüttner
52819663f8 Better naming plus minor changes
Signed-off-by: Nick Jüttner <nick@juni.io>
2018-06-01 09:31:21 +02:00
Nick Jüttner
efe46c429d annotation with upper-case hostnames block further updates
Signed-off-by: Nick Jüttner <nick@juni.io>
2018-05-31 16:58:57 +02:00
Till Klocke
5d54849699 Implementation of multiple targets based on PR #404 and #396 (#418)
* Endpoint.Target is now Endpoint.Targets. This is its own type representing mutliple targets for a single DNS name while adding some convenience for sorting and comparing

* Made everything compile and tests run through with the new Endpoint.Targets

* The ingress source can now properly handle multiple target ips per host

* Added custom conflict resolver, to better understand how conflict resolution has to work for me

* My custom conflict resolver behaves a bit different than the PerResource resolver, therefore I needed to modify the expected test result

Removed unnecessary FIXME

* The ingress source now creates CNAME endpoints with multiple targets to let the DNS provider decide how to handle multiple CNAME targets. This could be interesting for weighted targets etc.

* Adopted the expected results to the new way we create endpoints for CNAMEs

* Removed Add method from Targets since manipulating the slice through here is unnecessary complicated and doesn't deliver enough convenience

* Reverted ConflictResolver to the original one. There is some discussing to do what the best way is to handle conflicts

* Added missing documenting comment to IsLess of Targets

* Added documenting comments to Targets,Targets.Same and NewTargets to clarify their intention and usage

* Service source now also generates endpoints with multiple targets

* Service and Ingress source now sort all Targets for every Endpoint to make order of Targets predictable

* Endpoints generated by the Google Cloud DNS provider now also have sorted Targets to make order of Targets predictable

* Modified provider dyn to be able to compile with multi target changes

* Fixed small nitpicks, so my code is acceptable

* Fixed merge method after updating to new Targets. Replacing '!=' with .Same of course needs a boolean negation

* Tests for dyn provider now also use the new Targets instead of Target

* Simplified extractServiceIps as implied by linki to make it more readable

* ref: change service ClusterIP retrieval again

* Added entry to CHANGELOG.md describing the new features contained in this PR
2018-02-21 18:11:45 +01:00
Yerken
ec07f45c8e Multi target plan ( Page Not Found ) (#404)
* Make suitableType() be Endpoint method

With this change it becomes possible to work with endpoint
of empty type in packages other than "provider". Also
it seems logical for a smart property getter without side effects
to be a method rather than a function in different package

* Make plan computation work correctly with multi-target domains

* fix drawing

* drop comments

* fix boilerplate header

* fix comment

* fix the bug with empty map

* rework registry to support random lables

*  serialize->serializeLabel function rename

* golint for err variable naming

* add additional test

* add tests for current case where one resource can generate multiple endpoints

* make labels have its own type, add serialization as a method

* add comment for exported error

* use greater rather than not equal zero

* update changelog
2017-12-14 11:21:07 +01:00