Suppress error message from grep when checking whether a subnet has a secondary range or not.

This commit is contained in:
Jing Ai 2018-03-05 09:54:11 -08:00
parent c6d0726df8
commit 977252d4b2

View File

@ -1713,7 +1713,7 @@ function create-subnetworks() {
--secondary-range "services-default=${SERVICE_CLUSTER_IP_RANGE}" --secondary-range "services-default=${SERVICE_CLUSTER_IP_RANGE}"
echo "Created subnetwork ${IP_ALIAS_SUBNETWORK}" echo "Created subnetwork ${IP_ALIAS_SUBNETWORK}"
else 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}" echo "${color_red}Subnet ${IP_ALIAS_SUBNETWORK} does not have a secondary range${color_norm}"
exit 1 exit 1
fi fi