From b0da40aedb229c872a7b8e4fbb6bd62811e0c08a Mon Sep 17 00:00:00 2001 From: Dylan Peck Date: Mon, 16 May 2022 18:55:10 +0100 Subject: [PATCH 1/2] update conditional for static IP creation There's a static IP address now being created by the cluster that has 'prime-server' in its name. Our current script matches with this other address, doesn't create the global static IP, and the Ingress is never successfully created/connected. Changing the pattern fixes this issue. --- scripts/create.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/create.sh b/scripts/create.sh index bac0165..606dbef 100755 --- a/scripts/create.sh +++ b/scripts/create.sh @@ -38,7 +38,7 @@ run_terraform() { generate_static_ip() { # Check to make sure static IP hasn't already been created, then register it. - if [[ $(gcloud compute addresses list | grep 'prime-server') = '' ]]; then + if [[ $(gcloud compute addresses list | grep ' prime-server') = '' ]]; then gcloud compute addresses create prime-server --global fi } From 8c52a2ae0cd298e549f992e2259dc8aa68b0649a Mon Sep 17 00:00:00 2001 From: Dylan Peck Date: Tue, 17 May 2022 11:32:55 +0100 Subject: [PATCH 2/2] use stricter regex for pattern --- scripts/create.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/create.sh b/scripts/create.sh index 606dbef..54d2c6b 100755 --- a/scripts/create.sh +++ b/scripts/create.sh @@ -38,7 +38,7 @@ run_terraform() { generate_static_ip() { # Check to make sure static IP hasn't already been created, then register it. - if [[ $(gcloud compute addresses list | grep ' prime-server') = '' ]]; then + if [[ $(gcloud compute addresses list | grep '^NAME:\sprime-server') = '' ]]; then gcloud compute addresses create prime-server --global fi }