69 Commits

Author SHA1 Message Date
Seena Fallah
736a2d58ae
feat!: generalize PTR record support from rfc2136 to all providers (#6232)
* feat(metrics): add source wrapper metrics for invalid and deduplicated endpoints

Add GaugeVecMetric.Reset() to clear stale label combinations between cycles.

Introduce invalidEndpoints and deduplicatedEndpoints gauge vectors in the
source wrappers package, partitioned by record_type and source_type. The
dedup source wrapper now tracks rejected (invalid) and de-duplicated
endpoints per collection cycle.

Update the metrics documentation and bump the known metrics count.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* feat(source): add PTR source wrapper for automatic reverse DNS

Implement ptrSource, a source wrapper that generates PTR endpoints from
A/AAAA records. The wrapper supports:

- Global default via WithCreatePTR (maps to --create-ptr flag)
- Per-endpoint override via record-type provider-specific property
- Grouping multiple hostnames sharing an IP into a single PTR endpoint
- Skipping wildcard DNS names

Add WithPTRSupported and WithCreatePTR options to the wrapper Config
and wire the PTR wrapper into the WrapSources chain when PTR is in
managed-record-types.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* feat(config): add --create-ptr flag and deprecate --rfc2136-create-ptr

Add the generic --create-ptr boolean flag to Config, enabling automatic
PTR record creation for any provider. Add IsPTRSupported() helper that
checks whether PTR is included in --managed-record-types.

Add validation: --create-ptr (or legacy --rfc2136-create-ptr) now
requires PTR in --managed-record-types, preventing misconfiguration.

Mark --rfc2136-create-ptr as deprecated in the flag description.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* refactor(rfc2136): remove inline PTR logic in favor of PTR source wrapper

Remove the createPTR field, AddReverseRecord, RemoveReverseRecord, and
GenerateReverseRecord methods from the rfc2136 provider. PTR record
generation is now handled generically by the PTR source wrapper before
records reach the provider.

Update the PTR creation test to supply pre-generated PTR endpoints
(simulating what the source wrapper produces) instead of relying on
the provider to create them internally.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* feat(controller): wire PTR source wrapper into buildSource

Pass the top-level Config to buildSource so it can read IsPTRSupported()
and the CreatePTR / RFC2136CreatePTR flags. When PTR is in
managed-record-types, the PTR source wrapper is installed in the
wrapper chain with the combined create-ptr default.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* chore(pdns): remove stale comment and fix whitespace

Remove an outdated comment about a single-target-per-tuple assumption
that no longer applies.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* docs: add PTR records documentation and update existing guides

Add docs/advanced/ptr-records.md covering the --create-ptr flag,
per-resource annotation overrides, prerequisites, and usage examples.

Update:
- annotations.md: document record-type annotation
- flags.md: add --create-ptr, mark --rfc2136-create-ptr as deprecated
- tutorials/rfc2136.md: point to generic --create-ptr flag
- contributing/source-wrappers.md: add PTR wrapper to the chain
- mkdocs.yml: add PTR Records navigation entry

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* feat(rfc2136)!: remove rfc2136-create-ptr in favor of create-ptr

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

---------

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2026-03-30 13:36:16 +05:30
Ivan Ka
564d5353b8
refactor(provider): introduce factory with uniform New consturctor (#6276)
* refactor(controller): move provider construction to provider/factory package

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

* refactor(controller): move provider construction to provider/factory package

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

* refactor(provider): introduce factory package with per-provider New constructors

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

* refactor(provider): introduce factory package with per-provider New constructors

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

* refactor(provider): introduce factory package with per-provider New constructors

* refactor(provider): introduce factory package with per-provider New constructors

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

* refactor(provider): introduce factory package with per-provider New constructors

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2026-03-16 13:29:37 +05:30
Ivan Ka
e21f1389fb
linter(usetesting): enable usetesting (#6266)
* linter(usetesting): enable usetesting

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

* linter(usetesting): enable usetesting

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

* linter(usetesting): enable usetesting

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

* linter(usetesting): enable usetesting

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

* linter(usetesting): enable usetesting

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

* linter(usetesting): enable usetesting

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2026-03-14 22:07:35 +05:30
Eneko
ecf45d6dbf
fix(rfc2136): wrap DNS resolution errors with SoftError to prevent crashes (#6227)
When nameservers cannot be resolved (e.g., DNS timeout), the provider now returns a SoftError instead of a regular error, allowing the controller to retry instead of crashing the pod.

- Modified List() to return provider.NewSoftError on nameserver failures
- Modified SendMessage() to return provider.NewSoftError on connection errors
- Modified ApplyChanges() to return provider.NewSoftErrorf for batch errors
- Added TestRfc2136NameserverFailureReturnsSoftError to verify behavior
- Follows same error handling pattern as AWS, Google, OCI providers
2026-03-12 22:09:35 +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
Ivan Ka
a23f2d5a9a
chore(lint): configure modernize linter (#6035)
* chore(lint): configure modernize linter

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

* chore(lint): configure modernize linter

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

* chore(lint): modernize linter

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

* chore(lint): configure modernize linter

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-12-27 22:04:33 +05:30
Till Hoffmann
222b95fdca
fix(docs): Fixing typos in docs and comments (#5995) 2025-12-05 11:16:57 -08:00
Pascal Bourdier
699e994a9c
ci(linter): add go-critic (#5875)
* ci: add go-critic linter

follow go-critic advices when possible

* docs: add a short description about go-critic
2025-10-01 09:06:19 -07:00
Ivan Ka
6e2fc4aa31
chore(codebase): enable linter nonamedreturns (#5594)
* chore(codebase): enable linter nonamedreturns

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

* chore(codebase): enable linter nonamedreturns

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-07-01 22:13:25 -07:00
schwajo
495e2023a7
fix(rfc2136): use correct index for accessing UpdateOld (#5542) 2025-06-29 15:00: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
Kubernetes Prow Robot
1c1b0c7d1b
Merge pull request #5426 from datum-labs/rfc2136-multi-zone-list
fix(rfc2136): collect existing records from all configured zones
2025-05-24 01:04:45 -07:00
Ivan Ka
e21607254d
chore(codebase): enable errorlint (#5439)
* chore(codebase): enable errorlint

* chore(codebase): enable errorlint

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-05-21 04:14:34 -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 katliarchuk
9a9661a4e5
chore(codebase): enable dupword linter 2025-05-20 23:55:20 +01:00
Joshua Reese
0f7f2602a1
Correctly collect existing records from all zones in RFC2136 provider.
Fixes https://github.com/kubernetes-sigs/external-dns/issues/5261
2025-05-16 16:06:08 -05:00
jeremy-boyle
6e8abf514c
Updated rfc2136 keydata to request credentials each time, this is due to loosing handle ctx, causing issues. 2025-05-12 10:30:22 -05:00
Ivan Ka
a6243cf6bb
chore(providers): rename custom TTL constants to defaultTTL (#5312)
* chore(provider): inline providers

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

* chore(provider): inline providers

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

* chore(provider): inline providers

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

* chore(provider): inline providers

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

* chore(provider): inline providers

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-04-27 14:59:25 -07:00
Jeremy-Boyle
781eb5c8ef
Added init work to support RFC2136 multiple hosts.
Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>

Fixed go tests, added checks to ensure multiple hosts, and RFC2136LoadBalancingStrategy is set and can be overritten

Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>

Documentation to support Multiple Hosts and Load Balancing features

Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>

WIP, counter not working correctly

Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>

Make pointers to the rfc2136 provider, fixed counter issue, log out last error.

Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>

Fix error with failover not working correctly

Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>

Repoint makefile us.gcr.io/k8s-artifacts-prod/external-dns

Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>

Repoint makefile us.gcr.io/k8s-artifacts-prod/external-dns

Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>

Fix changes that arent related directly to this PR

Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>

Changed comment message details for counter

Signed-off-by: Jeremy-Boyle <9406398+Jeremy-Boyle@users.noreply.github.com>
2025-01-28 17:06:41 -06:00
angeloxx
1d93309e7f lint 2024-05-13 15:43:24 +02:00
angeloxx
a0040a4603 add PTR creation task 2024-05-13 15:31:18 +02:00
angeloxx
cd2088dff3 Merged from master and tested. 2024-03-19 13:27:17 +01:00
angeloxx
2f7f6390d0 Update implemented. 2024-02-26 22:27:13 +01:00
angeloxx
bab7a84f11 Fix test coverage 2024-02-26 22:15:46 +01:00
Kyle Butt
a3c9908d5e
RFC2136: Add support for DNS-over-TLS
*  Reuse the existing TLS options.
 *  Add two new flags, one to enable DNS-over-TLS, and the second to
    disable cert checks for DNS-over-TLS.
 *  Factor out the connection code so that it can be shared between the
    zone transfer and the updates. If TLS was requested, it will be used
    for both.
 *  RFC9013 requires TLS 1.3 or later, and an ALPN negotiation of "dot".
2024-02-26 11:23:34 -07:00
angeloxx
b083e34dfb Rename option with --rfc2136-create-ptr, similar to infoblox option 2024-02-25 18:50:35 +01:00
angeloxx
940899b758 Add command line parameter and update helm 2024-02-25 18:40:12 +01:00
angeloxx
5c01e953b4 Useless test removed, test with AD and sync mode 2024-02-25 17:55:57 +01:00
angeloxx
0efdfb3488 Initial support to PTR 2024-02-25 16:27:02 +01:00
Greg Sidelinger
8e9a4169a5 Cleanup error msgs
Signed-off-by: Greg Sidelinger <gate@ilive4code.net>
2024-01-02 14:12:20 +00:00
Greg Sidelinger
2b4aa56169 Cleanup extra whitespace to make the linter happy
Signed-off-by: Greg Sidelinger <gate@ilive4code.net>
2023-12-20 18:45:16 +00:00
Greg Sidelinger
35dc1fc0b9 Update rfc2136 test suite to deal with ording when dealing with multi zones
Signed-off-by: Greg Sidelinger <gate@ilive4code.net>
2023-12-20 16:26:39 +00:00
Greg Sidelinger
7427c8ed3f Only log zone once for the SendMessage
Signed-off-by: Greg Sidelinger <gate@ilive4code.net>
2023-12-20 14:00:31 +00:00
Greg Sidelinger
1418a3ace3 Update the rfc2136 mutlizone fix to support the default root zone
Add some tests for rfc2136 multizones

Signed-off-by: Greg Sidelinger <gate@ilive4code.net>
2023-12-20 13:56:40 +00:00
Greg Sidelinger
e3b8e5477b Merge branch 'master' of https://github.com/kubernetes-sigs/external-dns into fix-multizone-rfc2136 2023-12-19 17:15:33 +00:00
Greg Sidelinger
e44aa65378 Update rfc2136 provider to send zone updates one zone at a time
Signed-off-by: Greg Sidelinger <gate@ilive4code.net>
2023-12-12 17:41:01 +00:00
Michel Loiseleur
3c570496e9 following review 2023-12-07 10:43:38 +01:00
Michel Loiseleur
497e481b60 fix rfc2136, following https://github.com/miekg/dns/pull/1479 2023-12-02 21:56:19 +01:00
s.kharlamov
0ac4740162 RFC2136: Small fixes of logs 2023-11-09 17:40:54 +00:00
s.kharlamov
411acc7895 RFC:2136: Remove unused param 2023-10-18 07:19:57 +00:00
s.kharlamov
7fb529965d RFC2136: return string from findMsgZone 2023-10-17 23:06:47 +00:00
s.kharlamov
714078dc95 RFC2136 Set zone to root if no set 2023-10-16 10:00:45 +00:00
s.kharlamov
98e9716044 RFC2136 Rename field zoneName to zoneNames 2023-10-16 09:34:02 +00:00
s.kharlamov
3e59dc3719 RFC2136: Do not repeat zones sort 2023-10-16 08:27:47 +00:00
CRASH-Tech
20b920064b
Update provider/rfc2136/rfc2136.go
Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
2023-10-16 11:22:54 +03:00
s.kharlamov
4794c01c6f Allow multiple RFC2136 zones 2023-10-08 22:48:48 +00:00
Protryon
8c75b5b18a always use tcp for rfc2136 2023-08-04 10:39:55 -07:00
Michel Loiseleur
e06ed8cc5d build(deps): bump dev-dependencies group with 40 updates 2023-06-16 17:15:35 +02:00
Jack Henschel
3ed22648cb rfc2136: remove deprecated MD5 key algorithm
Signed-off-by: Jack Henschel <jack.henschel@cern.ch>
2022-11-25 13:03:43 +01:00
Andy Bursavich
74ffff6c26 gofumpt 2022-09-20 20:48:57 -07:00