fix(swarm-test): give the underlay arm the lab addresses

The same INFINITO_SWARM_*_IP topology SPOT the mesh writer already uses
for its endpoints, lifted into a map the transport switch can dial.
This commit is contained in:
evangelostsak committed 2026-10-08 10:58:23 +02:00
1 parent 63ade1e03b
commit d281555945
1 file changed
+13 -5
+13 -5
View File
@@ -24,14 +24,22 @@ _LAB_ADDRESSES = {
}
def _lab_endpoints() -> list[str]:
"""`--endpoint` argument per lab node, from the topology default.env names."""
arguments: list[str] = []
def _lab_address_map() -> dict[str, str]:
"""Underlay address per lab node name, from the topology default.env names."""
mapping: dict[str, str] = {}
for name_var, address_var in _LAB_ADDRESSES.items():
name = os.environ.get(name_var, "").strip()
address = os.environ.get(address_var, "").strip()
if name and address:
arguments += ["--endpoint", f"{name}={address}"]
mapping[name] = address
return mapping
def _lab_endpoints() -> list[str]:
"""`--endpoint` argument per lab node, from the topology default.env names."""
arguments: list[str] = []
for name, address in _lab_address_map().items():
arguments += ["--endpoint", f"{name}={address}"]
return arguments
@@ -157,7 +165,7 @@ def switch_to_mesh_transport(*, inv_dir: str) -> int:
_MESH_NAME,
user="administrator",
private_key_file=os.environ.get("KEY_PATH") or _DEFAULT_ADMIN_KEY,
keep_address=underlay,
addresses=_lab_address_map() if underlay else None,
)
if underlay:
print("[INFO] SSH on the underlay: the tunnel carries no deploy traffic", flush=True)