From 977252d4b2baf616608d697ab0e0ab7a432cc42c Mon Sep 17 00:00:00 2001 From: Jing Ai Date: Mon, 5 Mar 2018 09:54:11 -0800 Subject: [PATCH 1/2] Suppress error message from grep when checking whether a subnet has a secondary range or not. --- cluster/gce/util.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index 0b71822683..aca8a34a37 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -1713,7 +1713,7 @@ function create-subnetworks() { --secondary-range "services-default=${SERVICE_CLUSTER_IP_RANGE}" echo "Created subnetwork ${IP_ALIAS_SUBNETWORK}" else - if ! echo ${subnet} | grep --quiet secondaryIpRanges ${subnet}; then + if ! echo ${subnet} | grep -qs secondaryIpRanges ${subnet} 2>/dev/null; then echo "${color_red}Subnet ${IP_ALIAS_SUBNETWORK} does not have a secondary range${color_norm}" exit 1 fi From 384868e570bc20360c0572205d88ed930a3809b4 Mon Sep 17 00:00:00 2001 From: Jing Ai Date: Fri, 16 Mar 2018 18:12:39 -0700 Subject: [PATCH 2/2] Suppress error message from grep by removing in the end as it is wrongly interpreted as a file. --- cluster/gce/util.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index aca8a34a37..392ec64eff 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -1713,7 +1713,7 @@ function create-subnetworks() { --secondary-range "services-default=${SERVICE_CLUSTER_IP_RANGE}" echo "Created subnetwork ${IP_ALIAS_SUBNETWORK}" else - if ! echo ${subnet} | grep -qs secondaryIpRanges ${subnet} 2>/dev/null; then + if ! echo ${subnet} | grep --quiet secondaryIpRanges; then echo "${color_red}Subnet ${IP_ALIAS_SUBNETWORK} does not have a secondary range${color_norm}" exit 1 fi