48 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
Seena Fallah
fd3e82cf9b
feat: add PTR to registry mapper and pdns trailing-dot types (#6281)
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2026-03-17 19:19:40 +05:30
Ivan Ka
867fe74145
docs(regexfilter): pitfalls in domain-filter zone partitioning (#6255)
* test(pdns): regex pitfalls in domain-filter zone partitioning

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

* test(pdns): regex pitfalls in domain-filter zone partitioning

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

* test(pdns): regex pitfalls in domain-filter zone partitioning

I'll enable https://github.com/ldez/usetesting

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

* test(pdns): regex pitfalls in domain-filter zone partitioning

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

* test(pdns): regex pitfalls in domain-filter zone partitioning

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

* test(pdns): regex pitfalls in domain-filter zone partitioning

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

* test(pdns): regex pitfalls in domain-filter zone partitioning

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

* test(pdns): regex pitfalls in domain-filter zone partitioning

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

* docs(regexfilter): pitfalls in domain-filter zone partitioning

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

* docs(regexfilter): pitfalls in domain-filter zone partitioning

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-03-17 02:37:36 +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
Seena Fallah
dc123262c6
feat(pdns): support GetDomainFilter interface (#6234)
* feat(pdns): support GetDomainFilter interface

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

* refactor(pdns): drop domainFilter from PDNSAPIClient

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

* fix(pdns): return authoritative zones from GetDomainFilter()

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

* refactor(pdns): drop PartitionZones from the interface

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

---------

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2026-03-12 22:09:43 +05:30
Vyacheslav Klimov
f4c758665b
feat(pdns): add --[no-]prefer-alias flag and alias annotation support (#6129)
* feat: add support for expand alias in pdns provider

* feat: codereview

* feat: rewrite docs

* feat: gofmt

* feat: rewrite using postprocessor

* feat: gofmt

* feat: update docs

* fix: prefer-alias respects existing annotations

* feat: update formatting verbs

* fix: fix return values and call sites after convertRRSetToEndpoints signature change

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: remove unused error return from convertRRSetToEndpoints

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 17:38:27 +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
vflaux
b2390a9187
chore(lint): replace with NewSoftErrorf when possible (#6061) 2025-12-30 15:48:34 +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
blsho
6703e3aaeb
fix(pdns): ensure trailing dot for NS records (#5992)
* fix(pdns): ensure trailing dot for NS records

* Fix formatting test typos, make trailing types to list, refer to types with const

* Simplify trailing dot condition

* Move trailing types comment to correct location
2025-12-09 07:47:30 -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
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
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 Ka
791601e2e3
chore(codebase): add nilnil return check (#5415)
* chore(code-quality): added nilnil return check

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

* chore(code-quality): added nilnil return check

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-05-19 00:19:16 -07:00
Julilla Paul
10f4a26184
chore: make CheckEndpoint an Endpoint type method 2025-02-10 11:20:39 -08:00
Julilla Paul
ad9f300589
chore: move validation to endpoint 2024-11-20 13:46:57 -08:00
Julilla Paul
edd7b0710c
chore: add validation for MX and SRV records 2024-11-13 11:19:05 -08:00
Kubernetes Prow Robot
7ef0e2e527
Merge pull request #4578 from Demonware/pdns-use-soft-errors
feat: add soft errors to pdns provider
2024-10-27 14:06:53 +00:00
Kubernetes Prow Robot
25b44e5c4e
Merge pull request #4648 from saravanan30erd/fix-mx-srv
Add support for MX and SRV records in pdns provider
2024-10-03 09:44:27 +01:00
romeroalx
dad4d13a2d fix for linting issue in provider/pdns/pdns.go 2024-09-19 11:31:25 +02:00
romeroalx
1a909b871d pdns provider: added optional argument to make server_id configurable 2024-09-17 20:43:45 +02:00
Saravanan Palanisamy
ab58f50c9e update test cases 2024-08-11 21:24:17 +04:00
Saravanan Palanisamy
f653ea1edd Add trailing dot for MX and SRV records in pdns provider 2024-08-01 13:54:17 +04:00
Julilla Paul
ee2219358b
fix: json marshal failure should be a real error 2024-07-04 13:06:19 -07:00
Julilla Paul
82b0fab8eb
feat: add soft errors to pdns provider
Add soft errors to pdns provider where it is possible to retry or recover
2024-06-26 09:22:31 -07:00
Thomas Maroschik
99b7abda7e feat: add debug message to CNAME to ALIAS conversion
Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
2024-01-10 18:12:49 +01:00
Thomas Maroschik
60450d09d0 fix(pdns): provider implicitly changes CNAME to ALIAS
Fixes: https://github.com/kubernetes-sigs/external-dns/issues/3970
2024-01-08 14:47:36 +01:00
Kubernetes Prow Robot
0483ffde22
Merge pull request #3839 from matusf/fix/pdns-tls-on
Make TLS enabled by default for PowerDNS provider
2023-09-05 11:24:51 -07:00
Matúš Ferech
7aa9d25067
Align PDNS provider with other providers by removing MatchParent
PNDS provider is the only one which uses MatchParent functionality. The
MatchParent functionality breaks domain and regex domain filters. It
also makes PDNS provider behave differently than other providers while
having the same configuration. MatchParent can be replaced by using
multiple domain filters. After discussion with maintainers we concluded
that MatchParent should be removed.
2023-08-14 12:49:23 +02:00
Matúš Ferech
806209544c
Add test for regex domain filter
This test is expected to fail and aims to show that regex domain filter
is not working.
2023-08-14 11:14:18 +02:00
Matúš Ferech
721c4e2110
Make TLS enabled by default for PowerDNS provider
All of the providers have TLS enabled by default so this change will
make PDNS provider behave as exected. Additionally, enabling TLS
by default is a good practice and previous bahaviour was a bit
misleading. It was possible to pass `--tls-ca` without
`--pdns-tls-enabled` and the PDNS provider would ignore the tls and
instantiate client with disabled tls. This change adds a flag to disable
the tls: `--pdns-skip-tls-verify`. Similar flag is used by pihole and
bluecat providers.

Additionaly this change makes providing custom TLS CA optional. It if is
not provided. A system certificates will be used. This makes PDNS behave
the same as other providers.
2023-08-14 11:06:43 +02:00
Matúš Ferech
7f61bbae44
Remove redundant test
Omited TLS config is the same as empty TLS config. It will default to
the same value.
2023-08-14 10:56:27 +02:00
Matúš Ferech
2d34694860
Refactor PDNS provider TLS tests
Use factory function which creates new PDNS provider. The only
changing argument is TLSConfig, so we can default all of the rest.
2023-08-14 10:56:25 +02:00
Ludovic Ortega
60102ed91f
fix: pdns logging 2023-08-04 14:41:11 +02:00
Kubernetes Prow Robot
f26fa4bb5f
Merge pull request #3338 from epollia/pdns_alias
create an alias when record in a zone another than the target
2023-06-26 02:37:45 -07:00
Skyler Mäntysaari
6f42a8a2da Initial IPv6 support 2023-03-30 17:49:28 -07:00
Shchukin Konstantin
16b8192783 create an alias when creord in a zone other than the target 2023-01-24 12:10:28 +07:00
Andy Bursavich
74ffff6c26 gofumpt 2022-09-20 20:48:57 -07:00
Eugene Venter
e32daefbbc pdns: also match parent zones when partitioning zones 2021-05-31 10:03:06 +12:00
Dave Salisbury
f4a1b675a9 pdns_test: update multiple/mixed record expected values 2021-02-25 17:49:20 +11:00
Dave Salisbury
94b8617889 pdns: create one endpoint per-rrset not one per-record
If you had an RRSet that contained multiple records, the provider would
end up generating multiple endpoints where really it needs to produce a
single endpoint with multiple targets.
2021-02-25 17:49:16 +11:00
Nick Jüttner
3388e3ddf1 improve linter quality for external-dns 2020-06-06 22:29:24 +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
Raffaele Di Fazio
82539e35a3 makes tests pass
Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>
2020-05-08 13:54:13 +02:00
Raffaele Di Fazio
db4224c705 restructures the providers (build only)
Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>
2020-05-08 13:05:17 +02:00