Skip to content

feat(k8s): resolve service pods via Discovery API endpoint slices#270

Merged
italovalcy merged 1 commit into
mainfrom
worktree-k8s-endpointslice-tests
Jul 9, 2026
Merged

feat(k8s): resolve service pods via Discovery API endpoint slices#270
italovalcy merged 1 commit into
mainfrom
worktree-k8s-endpointslice-tests

Conversation

@italovalcy

Copy link
Copy Markdown
Contributor

Services whose selector does not match pod app/clabernetes labels (or selectorless services) are now associated with their pods through the EndpointSlice collection: slices owned by the service map its endpoints' targetRef uids back to the listed pods.

Hardening on top of the initial change, all pinned by tests:

  • list_namespaced_endpoint_slice used self.namespace (NameError before)
  • DiscoveryV1Api held on the controller like the other API clients
  • optional fields tolerated: endpoints, endpoint.target_ref (external IPs), metadata.owner_references (manually managed slices)
  • selectorless services (spec.selector None) no longer crash the listing
  • slice-mapped pods that do not belong to the requested lab are ignored (would KeyError on pod_services for NodePort links)

Services whose selector does not match pod app/clabernetes labels (or
selectorless services) are now associated with their pods through the
EndpointSlice collection: slices owned by the service map its endpoints'
targetRef uids back to the listed pods.

Hardening on top of the initial change, all pinned by tests:
- list_namespaced_endpoint_slice used self.namespace (NameError before)
- DiscoveryV1Api held on the controller like the other API clients
- optional fields tolerated: endpoints, endpoint.target_ref (external
  IPs), metadata.owner_references (manually managed slices)
- selectorless services (spec.selector None) no longer crash the listing
- slice-mapped pods that do not belong to the requested lab are ignored
  (would KeyError on pod_services for NodePort links)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@italovalcy italovalcy self-assigned this Jul 9, 2026
@italovalcy italovalcy merged commit 8ad9caa into main Jul 9, 2026
2 checks passed
@italovalcy italovalcy deleted the worktree-k8s-endpointslice-tests branch July 9, 2026 11:53
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