Skip to content

Commit a9bedb5

Browse files
authored
Disconnect if no nodes found (#4470)
1 parent a419f8c commit a9bedb5

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

packages/grid_client/scripts/zos3lite_gateway_domain.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,16 @@ async function main() {
3434
farmName: "LiriaFarm",
3535
};
3636

37+
const gatewayNodes = await grid3.capacity.filterNodes(gatewayQueryOptions);
38+
if (gatewayNodes.length === 0) {
39+
log("No nodes found for gateway. Skipping test.");
40+
await grid3.disconnect();
41+
return;
42+
}
43+
3744
const gw: GatewayNameModel = {
3845
name: gatewayName,
39-
node_id: +(await grid3.capacity.filterNodes(gatewayQueryOptions))[0].nodeId,
46+
node_id: +gatewayNodes[0].nodeId,
4047
tls_passthrough: false,
4148
// the backends have to be in this format `http://ip:port` or `https://ip:port`, and the `ip` pingable from the node so using the ygg ip or public ip if available.
4249
backends: ["http://185.206.122.35:8000"],

0 commit comments

Comments
 (0)