fix(core): project a reference's base_url on a bound requires
_target_url only resolved http_exposed deployments, so a `requires` with a `bind` pointing at a `manager: none` reference (an external resource) injected nothing. Return the reference's base_url, so binding an external endpoint into a consumer's env works — e.g. litellm's vllm-payne reference → VLLM_API_BASE.
This commit is contained in:
@@ -516,6 +516,11 @@ def _target_url(config: CastleConfig, target_name: str) -> str | None:
|
|||||||
dep = matches[0][1] if matches else None
|
dep = matches[0][1] if matches else None
|
||||||
if dep is None:
|
if dep is None:
|
||||||
return None
|
return None
|
||||||
|
# A reference (manager: none) carries its URL directly — that's what a bind to
|
||||||
|
# an external resource projects into the consumer's env.
|
||||||
|
base = getattr(dep, "base_url", None)
|
||||||
|
if base:
|
||||||
|
return base
|
||||||
expose = getattr(dep, "expose", None)
|
expose = getattr(dep, "expose", None)
|
||||||
http = getattr(expose, "http", None) if expose else None
|
http = getattr(expose, "http", None) if expose else None
|
||||||
tport = http.internal.port if http else None
|
tport = http.internal.port if http else None
|
||||||
|
|||||||
Reference in New Issue
Block a user