Repository navigation
fix(registry): namespace-qualify the kubernetes backend's service keys (020) - #427
Merged
Merged
Conversation
…s (020)
The kubernetes registry backend keyed endpoints by the BARE pod ServiceAccount
name, while the CNI registration path (registry/cni.go) and the etcd/ddb backends
all key by the namespace-qualified "<ns>/<sa>" (proposal 020 Part 1). Two
consequences with the kubernetes backend:
- serviceref.ParseKey REJECTS bare keys (no "/"), so the mesh-Service VIP generator
skipped EVERY SA-backed service ("malformed non-namespaced key") — no SA-backed
mesh Services, so that traffic fell to the redirect-all passthrough / kube-proxy.
- same-named ServiceAccounts in different namespaces (e.g. echo-v1 in two
conformance namespaces) collided into ONE bare "echo-v1" entry whose merged
endpoint set then oscillated and churned the agent's xDS snapshot.
Key by serviceref.New(pod.Namespace, pod.Spec.ServiceAccountName).Key() in both
ListAllEndpoints and ListEndpoints, matching the rest. Production uses dynamodb/etcd
(already correct), so this is low-risk there; it is the conformance backend
(registryBackend: kubernetes) and the suspected MESH-HTTP MeshFrontend root.
Tests: existing cases updated to "<ns>/<sa>"; new TestListAllEndpoints_SameSA
NamespaceIsolation proves two namespaces no longer collide. Conformance impact (the
mesh-http job is soft) to be confirmed by the post-merge run.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N7oY7W8oDXrqDzFgoZh25S
bpalermo
added a commit
that referenced
this pull request
Jun 28, 2026
…ckends (#428) Follow-up to #427 (the kubernetes backend had silently bypassed serviceref). Adds a shared registrytest.RequireNamespaceQualifiedKeys the key-DERIVING backends run on their ListAllEndpoints output, asserting (1) every key is a serviceref-parseable "<ns>/<sa>" and (2) no endpoint's namespace disagrees with its key's namespace (the cross-namespace collision). Wired into the kubernetes backend test. The keying format is centralized in common/serviceref and the write path qualifies once in registry/cni.go; storage backends (etcd/dynamodb) are key-agnostic passthroughs of the caller's key, so the contract targets the backends that DERIVE keys (kubernetes today) — the place divergence can recur. Claude-Session: https://claude.ai/code/session_01N7oY7W8oDXrqDzFgoZh25S Co-authored-by: Claude Opus 4.8 <[email protected]>
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.
The kubernetes registry backend keyed endpoints by the BARE ServiceAccount name, unlike the CNI/etcd/ddb paths which use
<ns>/<sa>(020). Becauseserviceref.ParseKeyrejects bare keys, the mesh-Service generator skipped every SA-backed service, and same-named SAs collided across namespaces (echo-v1 in the two conformance namespaces) → merged endpoint set → oscillation → agent xDS churn (the suspected MeshFrontend root + the residual 3-fail flap).Namespace-qualifies both
ListAllEndpoints/ListEndpointsto match the rest. Production uses dynamodb/etcd (correct already), so low-risk there; this is the conformance backend. NewTestListAllEndpoints_SameSANamespaceIsolationproves the cross-namespace isolation; existing cases updated to<ns>/<sa>. The softmesh-httpjob will confirm the conformance score impact post-merge. 🤖 Generated with Claude Code