refactor(pdns): replace unmaintained ffledgling/pdns-go with joeig/go-powerdns/v3#6486
refactor(pdns): replace unmaintained ffledgling/pdns-go with joeig/go-powerdns/v3#6486mloiseleur wants to merge 2 commits into
Conversation
Coverage Report for CI Build 27509177264Coverage decreased (-0.02%) to 81.341%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions53 previously-covered lines in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
|
Tested this change locally end-to-end against PowerDNS 4.9 ( Create: time="2026-06-11T02:40:50+02:00" level=info msg="CREATE: echo.example.com 0 IN A 10.96.185.122 []"
time="2026-06-11T02:40:50+02:00" level=info msg="CREATE: a-echo.example.com 0 IN TXT \"heritage=external-dns,external-dns/owner=local-test,external-dns/resource=service/default/echo\" []"
time="2026-06-11T02:40:50+02:00" level=info msg="Changes pushed out to PowerDNS in 5.24128ms\n"Update after time="2026-06-11T02:41:05+02:00" level=info msg="UPDATE-NEW: echo.example.com 120 IN A 10.96.185.122 []"
time="2026-06-11T02:41:05+02:00" level=info msg="UPDATE-NEW: a-echo.example.com 0 IN TXT \"heritage=external-dns,external-dns/owner=local-test,external-dns/resource=service/default/echo\" []"Delete after time="2026-06-11T02:41:05+02:00" level=info msg="DELETE: echo.example.com 120 IN A 10.96.185.122 []"
time="2026-06-11T02:41:05+02:00" level=info msg="DELETE: a-echo.example.com 0 IN TXT \"heritage=external-dns,external-dns/owner=local-test,external-dns/resource=service/default/echo\" []"Also tested with the API behind an nginx reverse proxy at a URL path prefix ( time="2026-06-11T02:41:38+02:00" level=info msg="CREATE: echo.example.com 0 IN A 10.96.215.157 []"
time="2026-06-11T02:41:38+02:00" level=info msg="Changes pushed out to PowerDNS in 4.454681ms\n"Resolution: $ dig +short @127.0.0.1 -p 1053 echo.example.com A
10.96.215.157Re-running with all records in place is a no-op: time="2026-06-11T02:46:41+02:00" level=info msg="All records are already up to date"@clwluvw @mark-liu @ngnix @blsho — you contributed to the PDNS provider in the last 2 years. If you can review this PR or test it, it would be great! |
…-powerdns/v3 The ffledgling/pdns-go client is pinned to a 2018 commit of a personal fork that has been idle since 2019 with no releases. Replace it with the actively maintained joeig/go-powerdns/v3 (MIT, zero runtime dependencies). The provider keeps the same PDNSAPIProvider interface and retry behavior; only the underlying client types change. A RoundTripper preserves URL path prefixes in --pdns-server (e.g. API behind a reverse proxy), which the new library would otherwise drop. Wire-level deltas: the deprecated set-ptr field (removed in PowerDNS >= 4.3) is no longer serialized, and the User-Agent header is now "go-powerdns".
Document how to test the PDNS provider end-to-end on a local machine: a disposable PowerDNS authoritative server in Docker and a kind cluster with an annotated Service. All commands verified against PowerDNS 4.9 (create, idempotent re-run, update, delete, dig resolution).
|
New changes are detected. LGTM label has been removed. |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ivankatliarchuk The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Motivation
The PowerDNS provider depends on
github.com/ffledgling/pdns-go, a swagger-generated client pinned to a 2018 commit of a personal fork — idle since 2019, zero releases. This PR replaces it withjoeig/go-powerdns/v3(actively maintained, MIT, no runtime dependencies).What does it do?
The provider's
PDNSAPIProviderinterface, retry logic, zone partitioning, and ALIAS handling are unchanged; only the client types underneath are swapped:ListZones→Zones.List,ListZone→Zones.Get,PatchZone→Records.Patch— samePATCH /servers/:id/zones/:zoneAPI calls.*http.Response(it was only used to debug-log error bodies; the new client parses the API error message into the returnederror).RoundTripperpreserves URL path prefixes in--pdns-server(e.g. API behind a reverse proxy athttps://host/pdns), which the library would otherwise rewrite away. Existing setups keep working.Minor wire-level changes:
set-ptrrecord field (removed in PowerDNS ≥ 4.3) is no longer serialized.User-Agentis nowgo-powerdns.Checklist
go test -race ./provider/pdns/...passes)