refactor: adopt the locations service API - #413
Draft
scotwells wants to merge 2 commits into
Draft
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,NetworkBindingandSubnetClaimkeep 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
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.LocationPublisher.LocationScopedResourcescoveringNetworkContextandSubnet. NSO's publisher hardcoded both, and deleting it drops them unless the new service is told.Related
Locationthat NetworkPresence now reads.