feat(cli): read the workspace listeners from the control plane

This commit is contained in:
Hugo Durand
2026-09-22 14:36:34 -04:00
parent 04a78aafad
commit 2ff8d6e950
4 changed files with 79 additions and 0 deletions
+23
View File
@@ -155,6 +155,29 @@ class ByName:
DeploymentSelector = ById | ByName
@dataclass(frozen=True, slots=True)
class Listener:
id: str
compute_id: str
namespaces: tuple[str, ...]
@classmethod
def from_resource(cls, resource: Mapping[str, object]) -> "Listener":
compute_config = resource.get("compute_config")
namespaces = (
compute_config.get("k8s_namespaces")
if isinstance(compute_config, Mapping)
else None
)
return cls(
str(resource.get("id", "")),
str(resource.get("compute_id", "")),
tuple(str(namespace) for namespace in namespaces)
if isinstance(namespaces, list)
else (),
)
@dataclass(frozen=True, slots=True)
class ExistingDeployment:
id: str