From 9c1093ff0c0de3ae1024b7d4932525769aed19ed Mon Sep 17 00:00:00 2001 From: Piyush Darshan Date: Mon, 2 Feb 2026 23:40:59 +0530 Subject: [PATCH] fix: read router port from service spec instead of hardcoded value - Modified GetRouterSvcUrl to read port from discovered service - Fallback to default DruidRouterPort (8088) if no ports defined - Fixes issue where custom port configurations broke DruidIngestion Fixes #220 --- pkg/druidapi/druidapi.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/druidapi/druidapi.go b/pkg/druidapi/druidapi.go index effda506..50263974 100644 --- a/pkg/druidapi/druidapi.go +++ b/pkg/druidapi/druidapi.go @@ -155,7 +155,13 @@ func GetRouterSvcUrl(namespace, druidClusterName string, c client.Client) (strin return "", errors.New("router svc discovery fail") } - newName := "http://" + svcName + "." + namespace + ":" + DruidRouterPort + // Get port from service spec, fallback to default DruidRouterPort + port := DruidRouterPort + if len(svcList.Items[0].Spec.Ports) > 0 { + port = fmt.Sprintf("%d", svcList.Items[0].Spec.Ports[0].Port) + } + + newName := "http://" + svcName + "." + namespace + ":" + port return newName, nil }