Skip to content

feat(dns): Designate DNS family (pcd_dns_zone, pcd_dns_recordset) — Phase 3 - #17

Merged
PF9-pushkar merged 2 commits into
mainfrom
feat/dns-designate
Jul 12, 2026
Merged

feat(dns): Designate DNS family (pcd_dns_zone, pcd_dns_recordset) — Phase 3#17
PF9-pushkar merged 2 commits into
mainfrom
feat/dns-designate

Conversation

@PF9-pushkar

Copy link
Copy Markdown
Collaborator

Second Phase 3 family — Designate DNS. New internal/services/dns package + a DNSV2Client (catalog type dns).

Resources & data source

  • pcd_dns_zone — PRIMARY/SECONDARY zones. name/type/attributes force replacement; email/ttl/masters/description are mutable.
  • pcd_dns_recordset — records within a zone (records as a Set to avoid reorder churn); composite zone_id/recordset_id import.
  • 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 for ACTIVE after create/update and for a 404 after delete. The waiters key on the ACTIVE/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: records is Required, 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), and terraform fmt on 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.

…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
PF9-pushkar merged commit 0db6712 into main Jul 12, 2026
4 checks passed
@PF9-pushkar
PF9-pushkar deleted the feat/dns-designate branch July 12, 2026 16:37
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant