mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
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:
parent
49bcbe648d
commit
c2238b46a2
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user