feat(): support dnszone classes. DNS Operations abstraction - #79
Conversation
…ments. wip(): unified interfaces for zone and recordset management Filters which DNSZone and DNSRecordSet resources to act on. Unifies DNS controller implementation with defined interfaces to support multiple API enpdpoint types in the future (e.g. powerdns, hickory)
feat(): change default class name to match current infra deployment for backward compatibility.
|
changeset tested on Staging @scotwells |
|
still waiting very much on review @scotwells @mattdjenkinson @0xmc |
|
Review of this branch on its own merits, separate from #82 which stacks on top of it. Verified by building BlockersThe class gate sits above the deletion path, so a non-matching zone can never finish deleting.
Create the second DNS class this PR exists to enable, delete one of its zones, and the object hangs in Terminating with no condition, event, or metric. Namespace deletion blocks behind it. "Defaults preserve current behaviour" holds for the single-class configuration in production today and fails for the multi-class configuration this PR is built for. Moving the gate below the
Four of the five behaviours the description claims are genuinely covered. Class filtering, the headline feature, is not. Seeding the DNSZoneClass object makes the un-gated build fail correctly.
Majors
Minors
On the staging soakThis commit has run in staging since 2026-08-10, which is weaker evidence than it looks. Staging has exactly one class, whose name matches the flag default. That is precisely the configuration in which none of the above can fire. |
ecv
left a comment
There was a problem hiding this comment.
Approving to unblock the stack. The findings in my previous comment are accepted risk rather than resolved, and I want that on the record here.
Three of them are worth carrying forward as follow-ups rather than losing: the class gate sitting above the deletion path, the class-filtering test that passes with the feature deleted, and the unguarded fake backend. None destroy data, and none can fire in the current single-class production configuration. They arrive with the second class, which is what this branch exists to enable.
The class gate reorder is a small change and fixes the same pattern in both this PR and #82.
Summary
This change makes downstream reconciliation class-aware so each controller instance only manages resources for its configured DNS zone class. It adds runtime flags for controller class and class type, with defaults that preserve current deployment behavior. It also refactors DNS operations behind a shared DNS handler and client interface so zone and recordset controllers use the same backend abstraction, including fake and PowerDNS implementations. Finally, it adds focused unit coverage for downstream DNSZone reconcile paths, including finalizer add, ensure, delete success, and delete failure retry behavior.
What changed
Added startup flags for selecting controller class and controller class type, then wired those into controller construction.
Introduced a shared DNS client interface and handler layer for zone and recordset operations.
Moved PowerDNS client code into the new DNS package layout and updated call sites.
Added fake DNS client implementation for deterministic tests.
Updated downstream reconcile logic to use class filtering and DNS abstraction methods.
Added unit tests for downstream DNSZone reconciliation and finalizer lifecycle.
Included small helper/normalization updates tied to status and nameserver handling.
Risks and rollout