Skip to content

test: DNS record reap suite for #283 (stacked on #284)#285

Merged
ecv merged 1 commit into
fix/dnszone-hostname-removal-reapfrom
test/283-dns-reap-suite
Jul 16, 2026
Merged

test: DNS record reap suite for #283 (stacked on #284)#285
ecv merged 1 commit into
fix/dnszone-hostname-removal-reapfrom
test/283-dns-reap-suite

Conversation

@ecv

@ecv ecv commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Test-only safety net for the DNS-record cleanup behind #283. Stacked on #284 — it merges into the fix, not main, and isn't meant to land on its own.

What it guards

  • A hostname removed from a proxy gets its DNS record cleaned up (apex and non-apex).
  • Deleting a gateway clears its records.
  • Deleting a proxy cascades cleanup to its gateway.

Why it's already green

These cover the cleanup machinery, which was already sound — the real #283 defect was upstream in how a hostname stays "claimed," fixed in #284. So the suite is a regression guard alongside the targeted test that ships with the fix, not a duplicate of it.

Not covered

A full end-to-end check that removal clears the record all the way through DNS — tracked separately.

Related to #283.

garbageCollectDNSRecordSets and cleanupDNSRecordSets were only ever
unit-tested in isolation; nothing drove the reconcile-level round
trip that actually reaps a stale hostname's DNS record in
production. Add three tests pinning the #283 behaviors:

Key changes:
- TestEnsureDNSRecordSets_HostnameRemovalReapsRecord: two
  ensureDNSRecordSets passes (hostname claimed, then removed) must
  GC the stale record while a still-claimed sibling survives; covers
  both CNAME (non-apex) and ALIAS (apex) record types
- TestCleanupDNSRecordSets_OnGatewayDeletion: Gateway finalization
  must reap all of its own DNSRecordSets without touching another
  gateway's records
- TestHTTPProxyDeletionCascadesDNSRecordCleanup: drives the real
  HTTPProxy reconcile to prove the Gateway owner-reference wiring
  native GC depends on, then simulates the GC cascade (the fake
  client runs no GC controller) and asserts cleanupDNSRecordSets
  reaps the child Gateway's records

All three pass on origin/main today, which narrows the #283 root
cause: the reap mechanisms themselves are correct, so the bug is
upstream in how claimedHostnames is computed/retained across
reconciles, not in garbage collection.

This is a test-only commit for a draft PR; it merges into the #283
fix branch and is not meant to land standalone.
@ecv
ecv force-pushed the test/283-dns-reap-suite branch from bde18a1 to f3ccc92 Compare July 16, 2026 15:56
@ecv
ecv requested a review from mattdjenkinson July 16, 2026 15:58
@ecv
ecv marked this pull request as ready for review July 16, 2026 15:59
@ecv
ecv merged commit 8433ffd into fix/dnszone-hostname-removal-reap Jul 16, 2026
8 checks passed
@ecv
ecv deleted the test/283-dns-reap-suite branch July 16, 2026 16:00
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