Skip to content

fix: read router port from service spec instead of hardcoded value#253

Open
piyush302 wants to merge 1 commit intodatainfrahq:masterfrom
piyush302:fix/dynamic-router-port
Open

fix: read router port from service spec instead of hardcoded value#253
piyush302 wants to merge 1 commit intodatainfrahq:masterfrom
piyush302:fix/dynamic-router-port

Conversation

@piyush302
Copy link
Copy Markdown
Contributor

Fixes #220

Description

The router port was hardcoded to 8088 in GetRouterSvcUrl(), which broke DruidIngestion for users who configured custom ports in their Druid CR.

This PR modifies the function to read the actual port from the discovered Kubernetes Service spec, with a fallback to the default port (8088) for backward compatibility.

Key changed/added files in this PR

  • pkg/druidapi/druidapi.go

Testing

  • Tested locally on kind cluster with podman
  • Patched router service to use custom port 9999
  • Verified operator correctly reads port from service spec:
    • Default port (8088): http://druid-tiny-cluster-routers.druid:8088/...
    • Custom port (9999): http://druid-tiny-cluster-routers.druid:9999/...
  • Backward compatibility maintained - existing deployments work without changes

- 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 datainfrahq#220
@piyush302
Copy link
Copy Markdown
Contributor Author

@AdheipSingh could you please review it . And let me know if anything else is required ?

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.

Bug: Hardcoded port 8088 for DruidRouterPort in druidapi.go

1 participant