Fix proxy:bool refactor drift in CLI fixture + dead structural key

The proxy->bool refactor (770574f) missed the shared CLI test fixture, which
still used proxy: {caddy: {path_prefix: ...}} — failing ~25 CLI tests with
'Input should be a valid boolean'. Set it to proxy: True.

Also drop the now-dead 'caddy' entry from _STRUCTURAL_KEYS (no nested caddy
key exists anymore) and refresh a stale proxy.caddy docstring reference.
This commit is contained in:
2026-06-30 21:45:44 -07:00
parent 14145c9f15
commit d0075300e3
3 changed files with 9 additions and 10 deletions

View File

@@ -55,9 +55,7 @@ def castle_root(tmp_path: Path) -> Generator[Path, None, None]:
"health_path": "/health", "health_path": "/health",
} }
}, },
"proxy": { "proxy": True,
"caddy": {"path_prefix": "/test-svc"},
},
"manage": { "manage": {
"systemd": {}, "systemd": {},
}, },

View File

@@ -158,10 +158,12 @@ def resolve_env_split(
(routing them through a mode-0600 env file) while inlining the rest. (routing them through a mode-0600 env file) while inlining the rest.
- ``${secret:NAME}`` reads `~/.castle/secrets/NAME`. - ``${secret:NAME}`` reads `~/.castle/secrets/NAME`.
- ``${port}`` / ``${data_dir}`` / ``${name}`` (and anything else in - ``${port}`` / ``${data_dir}`` / ``${name}`` / ``${public_url}`` (and
``context``) expand to castle's computed values, so a service maps them to anything else in ``context``) expand to castle's computed values, so a
whatever env var its program reads (e.g. ``MY_PORT: ${port}``) without service maps them to whatever env var its program reads (e.g.
hardcoding or castle silently injecting a guessed var name. ``MY_PORT: ${port}``) without hardcoding or castle silently injecting a
guessed var name. ``${public_url}`` is the service's gateway-facing base
URL (``https://<name>.<domain>`` under acme) — the origin an app allowlists.
""" """
context = context or {} context = context or {}
plain: dict[str, str] = {} plain: dict[str, str] = {}
@@ -329,7 +331,6 @@ _STRUCTURAL_KEYS = {
"systemd", "systemd",
"expose", "expose",
"proxy", "proxy",
"caddy",
} }

View File

@@ -55,8 +55,8 @@ def service_proxy_targets(name: str, svc: ServiceSpec) -> ProxyTargets:
The single source of truth shared by the registry build (``deploy``) and The single source of truth shared by the registry build (``deploy``) and
route computation (``compute_routes``), so they never disagree. ``expose`` is route computation (``compute_routes``), so they never disagree. ``expose`` is
the checkbox (``proxy.caddy`` present and enabled); the subdomain is always the the checkbox (``proxy: true``); the subdomain is always the service name, so
service name, so there's nothing else to derive. there's nothing else to derive.
""" """
port = None port = None
if svc.expose and svc.expose.http: if svc.expose and svc.expose.http: