Skip to content

fix(dns plugin): refuse ambiguous zones and add --vpc - #474

Merged
scotwells merged 5 commits into
mainfrom
fix/cli-ambiguous-zone
Nov 12, 2026
Merged

scotwells merged 5 commits into
mainfrom
fix/cli-ambiguous-zone

Conversation

@scotwells

@scotwells scotwells commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Scot Schuchert-Wells · project thread

Summary

Private zones can share a domain. Every VPC's default zone is datum.internal. Until now, the datumctl dns zone and record commands quietly used the first zone that matched a domain. In a project with more than one VPC, a record could be written to another VPC's zone.

With this change:

  • When more than one zone could be meant, the command is refused. The error lists each zone and the VPCs that use it. A private zone that is being deleted still counts, so a write can't fall through to another VPC's zone.
  • A new --vpc <name> flag picks the zone that VPC resolves: its default zone, or a zone attached to it and accepted. The VPC is matched by its identity, not by a label that can be edited.
  • A zone's object name selects that zone directly. If it also matches another zone's domain, the command is refused.
  • Suggested commands name a zone by object whenever its domain is shared. Deleting a private zone asks you to confirm with its object name.
  • Projects where each domain has only one zone see no change.
  • The CLI guide documents --vpc.

Related: datum-cloud/enhancements#921, #419

Test plan

  • New tests: two VPCs sharing datum.internal (refused without --vpc, right zone with it), accepted versus pending associations, labels that don't match the VPC, an unknown VPC, object name with and without a mismatched --vpc, a private zone being deleted, a public zone being deleted, an object name colliding with a domain, a public and a private zone sharing a domain, --vpc on a public zone, and private zone delete confirmation.
  • Local tamper run: when a private zone being deleted is skipped again, the new test fails.
  • CI green.

Generated by Claude Code

Private zones can share a domain: every VPC's default zone is
datum.internal. The zone and record commands took the first zone matching
the domain, so in a project with two VPCs a record write could land in
the other VPC's zone.

The commands now refuse a domain that matches more than one zone and list
the candidates with the VPCs that use them. --vpc picks the zone a VPC
resolves, through its resolver context's default zone and its zone
associations. A zone's object name still selects it directly.
Next-step hints and fixes now name a private zone by its object name, so
the command they suggest does not hit the ambiguity error. Zones and
resolver contexts being deleted no longer make a domain or VPC look
ambiguous. --vpc on a public zone says so, the ambiguity list marks public
zones and zones whose VPC could not be read, and a project whose contexts
do not yet record their VPC gets an error that says that. zone create no
longer counts private zones as holding a public domain.
@cla-assistant

cla-assistant Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Without --vpc, a private zone being deleted no longer drops out of the
match, so a write cannot fall through to another VPC's zone. A typed
argument now matches zones by domain and by object name together, so a
dotted object name cannot shadow another zone's domain.

--vpc now resolves the VPC by name to its network UID and matches it
against each resolver context's immutable consumerID instead of a
mutable label, and only accepted zone associations count.

A public zone that shares its domain with a private zone is named by
object in suggested commands. Deleting a private zone asks for its object
name, and prompts name the zone object. The CLI guide documents --vpc.
@scotwells
scotwells force-pushed the fix/cli-ambiguous-zone branch from 15c3375 to af9e4d1 Compare November 12, 2026 00:17
@scotwells
scotwells marked this pull request as ready for review November 12, 2026 00:34
@scotwells
scotwells requested a review from a team as a code owner November 12, 2026 00:34
@scotwells
scotwells requested review from ecv and kevwilliams November 12, 2026 00:34

@kevwilliams kevwilliams left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified --vpc matches the projectUID/networkUID consumerID network services writes, uses only v0.14.0 API fields, and merges cleanly after #522.

@scotwells
scotwells merged commit a51f476 into main Nov 12, 2026
17 checks passed
@scotwells
scotwells deleted the fix/cli-ambiguous-zone branch November 12, 2026 00:56
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.

2 participants