Skip to content

Use request host in SelectCluster#7232

Merged
EngHabu merged 1 commit intov2from
enghabu/fix-selectcluster-url
Apr 17, 2026
Merged

Use request host in SelectCluster#7232
EngHabu merged 1 commit intov2from
enghabu/fix-selectcluster-url

Conversation

@EngHabu
Copy link
Copy Markdown
Contributor

@EngHabu EngHabu commented Apr 17, 2026

Why are the changes needed?

SelectCluster previously returned a statically configured dataplaneDomain (the dataproxy baseURL) as the cluster endpoint for every caller. That forced all clients to talk to the same hostname regardless of how they actually reached the service — breaking setups where the same deployment is fronted by multiple hostnames (e.g. per-tenant/per-region ingresses, local port-forwards, or internal vs. external URLs).

Using the request's Host header lets the server echo back whatever host the client used to reach it, so clients keep talking to the endpoint they already have a working route to.

What changes were proposed in this pull request?

  • SelectCluster now reads the Host header off the inbound request and returns it as ClusterEndpoint.
  • Removed the dataplaneDomain field and constructor argument from ClusterService; NewClusterService() no longer needs the configured base URL.
  • Updated dataproxy/setup.go to call the simplified constructor, plus a minor import ordering cleanup.

How was this patch tested?

Manual verification via the dataproxy endpoint — SelectCluster now returns the host the client used to reach it rather than the configured dataplane domain.

Labels

  • fixed

Check all the applicable boxes

  • All commits are signed-off.

Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>
@github-actions github-actions bot mentioned this pull request Apr 17, 2026
3 tasks
@EngHabu EngHabu marked this pull request as ready for review April 17, 2026 17:37
@EngHabu EngHabu merged commit 17dd7d9 into v2 Apr 17, 2026
20 checks passed
@EngHabu EngHabu deleted the enghabu/fix-selectcluster-url branch April 17, 2026 18:03
@pingsutw pingsutw added this to the V2 GA milestone Apr 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants