Skip to content

refactor: adopt the locations service API - #413

Draft
scotwells wants to merge 2 commits into
mainfrom
refactor/locations-api
Draft

refactor: adopt the locations service API#413
scotwells wants to merge 2 commits into
mainfrom
refactor/locations-api

Conversation

@scotwells

@scotwells scotwells commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Locations were defined twice: here, and in the service that now owns them. NSO reads that service and stops serving its own copies.

Nothing changes for anyone consuming NSO's APIs. Subnet, NetworkContext, NetworkBinding and SubnetClaim keep the same shape. A control plane that does not serve the new group reads as empty rather than failing, so nothing breaks while the migration is in flight.

NSO's location publisher is deleted. The same code runs in the locations service, and both wrote the same federation records under the same identity, so running the pair made them fight over it.

Before this ships

  1. Remove locationPublisher: from NSO's staging config in the same change that ships this image. Config decoding is strict, so an unknown field crashloops the manager on startup.
  2. Configure the locations service with LocationPublisher.LocationScopedResources covering NetworkContext and Subnet. NSO's publisher hardcoded both, and deleting it drops them unless the new service is told.

Related

  • milo-os/locations is the service this adopts. datum-cloud/infra#4182 deployed it to staging.
  • feat: project Locations from the locations service milo-os/service-catalog#78 writes the projected Location that NetworkPresence now reads.
  • datum-cloud/infra#4248 declares the locations and turns on readiness reporting.
  • datum-cloud/go-imports#65 registered the module's vanity import path, which is why this depends on it directly.

Location and ServingLocation were defined here for convenience, and the
platform has since grown a service that owns them: milo-os/locations, group
locations.miloapis.com. Two definitions of the same concept is one too many,
and the duplicate publisher behind them writes the same federation objects the
new service writes.

NSO now reads locations.miloapis.com and stops serving its own copies. It keeps
LocationBinding, which has no counterpart in the new group and is still written
by the service catalog, but no longer reads it: NetworkPresence gates on the
Location projected into a project control plane instead, which is the
projection the service catalog is moving to.

Key changes:
- Delete Location and ServingLocation, and read locations.miloapis.com in the
  subnet controller, NetworkPresence and the cell identity path
- Take LocationReference from the locations module rather than redeclaring it,
  leaving the Subnet, NetworkContext, NetworkBinding and SubnetClaim schemas
  unchanged
- Delete the location publisher: the same code now runs in the locations
  service, and both would write ClusterPropagationPolicy/location-<name> under
  the same field manager
- Resolve identity through locationidentity.Resolve, and treat a control plane
  that does not serve locations.miloapis.com as an empty read so an unmigrated
  plane degrades rather than errors
- Vendor the two locations CRDs the operator reads, install them where NSO
  needs them, and drop the Location IAM roles, protected resource and resource
  metrics
The module path go.miloapis.com/locations did not resolve, so the dependency
was pinned through a replace onto the GitHub path. The vanity import is now
registered and the module downloads from the public proxy.

Key changes:
- Require go.miloapis.com/locations at its own path and drop the replace
ecv added a commit that referenced this pull request Sep 9, 2026
The registry-coverage test named every metric by hand, so a metric
added later with a bare promauto.New* call (registering against
prometheus.DefaultRegisterer instead of ctrlmetrics.Registry) stayed
invisible to it. Add a second test that gathers
prometheus.DefaultGatherer directly and fails on any "nso_" family
that isn't "nso_extension_", catching that mistake regardless of
which metric it is.

Also drop the three location metrics from the hand-maintained name
list: draft PR #413 deletes them, and naming them here would make that
PR fail to build against this branch.

Claude-Session: https://claude.ai/code/session_011XoSfWG6XKn8ckkRAAGiCP
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