MCPcopy
hub / github.com/gitpod-io/gitpod / workspacePodResolver

Function workspacePodResolver

components/ws-proxy/pkg/proxy/routes.go:386–390  ·  view source on GitHub ↗

workspacePodResolver resolves to the workspace pod's url from the given request.

(config *Config, infoProvider WorkspaceInfoProvider, req *http.Request)

Source from the content-addressed store, hash-verified

384
385// workspacePodResolver resolves to the workspace pod's url from the given request.
386func workspacePodResolver(config *Config, infoProvider WorkspaceInfoProvider, req *http.Request) (url *url.URL, err error) {
387 coords := getWorkspaceCoords(req)
388 workspaceInfo := infoProvider.WorkspaceInfo(coords.ID)
389 return buildWorkspacePodURL(workspaceInfo.IPAddress, fmt.Sprint(config.WorkspacePodConfig.TheiaPort))
390}
391
392// workspacePodPortResolver resolves to the workspace pods ports.
393func workspacePodPortResolver(config *Config, infoProvider WorkspaceInfoProvider, req *http.Request) (url *url.URL, err error) {

Callers

nothing calls this directly

Calls 3

getWorkspaceCoordsFunction · 0.85
buildWorkspacePodURLFunction · 0.85
WorkspaceInfoMethod · 0.65

Tested by

no test coverage detected