Skip to content

Commit

Permalink
get-ip doesn't throw error when load balancer not running
Browse files Browse the repository at this point in the history
  • Loading branch information
DougReeder committed Oct 25, 2024
1 parent 88a892a commit a780495
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions community-edition/get_ip/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ const { stdout } = spawnSync(
{ stdio: ["pipe", "pipe", "inherit"] }
);
const output = JSON.parse(stdout);
console.log(
"load balancer external IP address:",
output.status.loadBalancer.ingress[0].ip
);
const ipAddr = output.status.loadBalancer?.ingress?.[0]?.ip;
if (ipAddr) {
console.log("load balancer external IP address:", ipAddr);
} else {
console.log("load balancer not running yet:", output.status.loadBalancer);
}

0 comments on commit a780495

Please sign in to comment.