Skip to content

frontend: do not connect to internal API via localhost

Administrator requested to merge sg/fx into master

Created by: slimsag

In #616 it was suggested to me that we could make the frontend connect to itself via 127.0.0.1, instead of via what is configured in SRC_FRONTEND_INTERNAL.

This is true, and would allow us to make requests never leave our machine (no network involved), but this change was unfortunately incorrect.

The code assumes that the internal port can be derived from SRC_FRONTEND_INTERNAL which is true in dev etc, but not true in Kubernetes cluster deployments where SRC_FRONTEND_INTERNAL=http://sourcegraph-frontend-internal because there is no port in the configured URL, but on localhost the port should be 3090 because that is the internal HTTPAPI port.

I don't see an easy / fool-proof way of solving this yet, and it has broken our telemetry in prod snce it was deployed yesterday due to this bug. So I am reverting this change here instead.

This PR does not need to update the CHANGELOG because no user-facing changes.

Merge request reports

Loading