feat(dns): Designate DNS family (pcd_dns_zone, pcd_dns_recordset) — Phase 3 - #17
Merged
Conversation
…set) Phase 3. New internal/services/dns package + a DNSV2Client (catalog type "dns") on the shared config. Resources: pcd_dns_zone (name/type/attributes ForceNew; email/ttl/masters/ description mutable) and pcd_dns_recordset (zone_id/name/type ForceNew; records/ ttl/description mutable, composite import zone_id/recordset_id). Data source: pcd_dns_zone (lookup by id/name). Designate zone and recordset create/update/delete are asynchronous: the object returns in a transient status and settles to ACTIVE, and delete leaves it pending until gone. Resources wait for ACTIVE after create/update and for 404 after delete (waiters keyed by the ACTIVE/ERROR/404 terminals, since Designate exposes no status constants). Records are a Set to avoid reorder churn. Acceptance test (zone + recordset + data source + import), examples under the new "DNS" registry subcategory, CHANGELOG, and DECISIONS row included. build/vet/gofmt/golangci-lint (0 issues) and tfplugindocs all clean.
… failure records is Required, but Designate canonicalizes some record types server-side (TXT is rewritten to the RFC-1035 quoted form). readInto wrote the normalized values back, so a naive TXT recordset failed with 'inconsistent result after apply'. Keep the configured value (echo-only) and populate from the server only on import, so the apply is consistent and the plan does not churn. Found by adversarial review.
PF9-pushkar
added a commit
that referenced
this pull request
Jul 14, 2026
feat(dns): Designate DNS family (pcd_dns_zone, pcd_dns_recordset) — Phase 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second Phase 3 family — Designate DNS. New
internal/services/dnspackage + aDNSV2Client(catalog typedns).Resources & data source
pcd_dns_zone— PRIMARY/SECONDARY zones.name/type/attributesforce replacement;email/ttl/masters/descriptionare mutable.pcd_dns_recordset— records within a zone (recordsas a Set to avoid reorder churn); compositezone_id/recordset_idimport.pcd_dns_zone(data source) — lookup by id/name.Async lifecycle
Designate zone and recordset create/update/delete are asynchronous — the object returns in a transient status and settles to
ACTIVE. Every apply waits forACTIVEafter create/update and for a 404 after delete. The waiters key on theACTIVE/ERROR/404 terminals rather than enumerating pending states (Designate exposes no status constants, and the pending spelling varies).Adversarial review fix included
The review caught a real bug:
recordsisRequired, but Designate canonicalizes some record types server-side (TXT → RFC-1035 quoted form), and the read wrote the normalized values back — so a naive TXT recordset (SPF/DKIM/DMARC) hard-failed with "inconsistent result after apply". Fixed with the echo-only pattern: keep the configured value, populate from the server only on import. No apply failure, no perpetual diff.Checks
go build/vet/gofmt/golangci-lint(0 issues),tfplugindocs generate(pages under the "DNS" subcategory), andterraform fmton the new examples all clean. Acceptance test covers a zone + recordset + data source + import.Live-validation status
Code-complete + adversarially reviewed. Not run against the CE lab this session (credentials unavailable). Unlike Octavia/compute/Cinder, DNS needs no compute/storage backend and Designate is live (Step 0), so this family should pass live once creds return. Tracked in
DECISIONS.md.