Skip to content

Commit 5e7baa8

Browse files
committed
fix: Add missing /mcp suffix to gateway url of tool server
1 parent 6511dda commit 5e7baa8

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

internal/controller/toolserver_reconciler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,8 @@ func (r *ToolServerReconciler) updateToolServerStatusReady(ctx context.Context,
327327
// Populate GatewayUrl if the ToolGateway has a URL in its status
328328
if toolGateway.Status.Url != "" {
329329
// Construct the gateway URL for this specific tool server
330-
// Format: {gatewayBaseUrl}/toolserver/{namespace}/{name}
331-
toolServer.Status.GatewayUrl = fmt.Sprintf("%s/toolserver/%s/%s",
330+
// Format: {gatewayBaseUrl}/toolserver/{namespace}/{name}/mcp
331+
toolServer.Status.GatewayUrl = fmt.Sprintf("%s/toolserver/%s/%s/mcp",
332332
toolGateway.Status.Url, toolServer.Namespace, toolServer.Name)
333333
} else {
334334
toolServer.Status.GatewayUrl = ""

internal/controller/toolserver_toolgateway_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,8 @@ var _ = Describe("ToolServer ToolGateway Resolution", func() {
510510
Expect(err).NotTo(HaveOccurred())
511511

512512
// Verify GatewayUrl is populated correctly
513-
expectedGatewayUrl := "http://tool-gateway.tool-gateway.svc.cluster.local:8080/toolserver/default/test-toolserver"
513+
expectedGatewayUrl := "http://tool-gateway.tool-gateway.svc.cluster.local:8080" +
514+
"/toolserver/default/test-toolserver/mcp"
514515
Expect(toolServer.Status.GatewayUrl).To(Equal(expectedGatewayUrl))
515516
Expect(toolServer.Status.ToolGatewayRef).NotTo(BeNil())
516517
Expect(toolServer.Status.ToolGatewayRef.Name).To(Equal("gateway-with-url"))

0 commit comments

Comments
 (0)