core: bind a raw-TCP service as <name>.<domain>:<port>
A `{ref, bind}` to a TCP-exposed deployment (e.g. postgres) projected
nothing, so consumers hardcoded the docker bridge IP. Project the address
it's already documented as reachable at.
This commit is contained in:
@@ -682,6 +682,11 @@ def _target_url(config: WildpcConfig, target_name: str) -> str | None:
|
||||
base = getattr(dep, "base_url", None)
|
||||
if base:
|
||||
return base
|
||||
# A raw-TCP service has no URL scheme — project its `host:port`, reachable
|
||||
# through wildcard DNS (see docs/tcp-exposure.md).
|
||||
tcp_port = getattr(dep, "tcp_port", None)
|
||||
if tcp_port and config.gateway.domain:
|
||||
return f"{target_name}.{config.gateway.domain}:{tcp_port}"
|
||||
expose = getattr(dep, "expose", None)
|
||||
http = getattr(expose, "http", None) if expose else None
|
||||
tport = http.internal.port if http else None
|
||||
|
||||
Reference in New Issue
Block a user