Change cluster/gce/util to wait for firewall rule creation

Add kube::util::wait-for-jobs in create-network() to wait
for background firewall rule creation, and if any fail, log
a message and exit with the failed job's return code.
This commit is contained in:
Brian Pursley 2022-08-03 17:23:27 -04:00
parent 49bcbe648d
commit c2238b46a2

View File

@ -2429,6 +2429,12 @@ function create-network() {
--allow "tcp:3389" & --allow "tcp:3389" &
fi fi
fi fi
kube::util::wait-for-jobs || {
code=$?
echo -e "${color_red}Failed to create firewall rules.${color_norm}" >&2
exit $code
}
} }
function expand-default-subnetwork() { function expand-default-subnetwork() {
@ -3099,7 +3105,9 @@ function create-nodes-firewall() {
# Wait for last batch of jobs # Wait for last batch of jobs
kube::util::wait-for-jobs || { kube::util::wait-for-jobs || {
echo -e "${color_red}Some commands failed.${color_norm}" >&2 code=$?
echo -e "${color_red}Failed to create firewall rule.${color_norm}" >&2
exit $code
} }
} }