Skip to content

cloudmock-dns: rename domainConfig.Autotend → Primary, accept primary YAML key #49

@Viridian-Inc

Description

@Viridian-Inc

Problem

After PR #36 / #38 / #42 / #46, the only remaining brand-leak in non-test Go was `tools/cloudmock-dns/main.go`: the `domainConfig` struct field `Autotend string` and the YAML key `autotend` used to read the primary domain from the user's Pulumi config. The field name was misleading even when the value defaulted to `cloudmock.app`.

Fix

  • `domainConfig.Autotend` → `domainConfig.Primary`
  • All call sites (`dc.Autotend`) → `dc.Primary`
  • `parsePulumiConfig` accepts `primary` as the canonical YAML key, falls back to `autotend` for backwards compat with existing autotend-infra Pulumi configs (with a comment explaining why)
  • `sortedDomains` pair key updated from `"cloudmock"` (which was duplicated) to `"primary"` for the primary entry — sort still groups them deterministically
  • Three new test cases:
    • `TestParsePulumiConfig_LegacyAutotendKey` — verifies the alias works
    • `TestParsePulumiConfig_PrimaryWinsOverLegacy` — verifies precedence when both keys are set
    • Existing `TestParsePulumiConfig` updated to use the new `primary` key

Out of scope

  • Cosmetic comment references to `autotend` in `pkg/iac/pulumi.go` (an example of input the parser should handle in the wild) and `pkg/gateway/proxy.go` (an explanation of which historical importers the aliases serve). Both are accurate descriptive context, not aspirational coupling.
  • Doc-site references in `website/src/content/docs/` and `docs/tailnet-proxy.md` (separate doc pass).

PR follows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions