Skip to content

Commit 34984fc

Browse files
author
OpenShift Bot
authored
Merge pull request #11404 from marun/dind-bump-depl-timeout
Merged by openshift-bot
2 parents b3871bb + ea68442 commit 34984fc

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

hack/dind-cluster.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ function wait-for-cluster() {
222222

223223
local msg="${expected_node_count} nodes to report readiness"
224224
local condition="nodes-are-ready ${kubeconfig} ${oc} ${expected_node_count}"
225-
os::util::wait-for-condition "${msg}" "${condition}"
225+
local timeout=120
226+
os::util::wait-for-condition "${msg}" "${condition}" "${timeout}"
226227
}
227228

228229
function nodes-are-ready() {

images/dind/master/openshift-disable-master-node.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function disable-node() {
1919

2020
local msg="${node_name} to register with the master"
2121
local condition="is-node-registered ${config} ${node_name}"
22-
os::util::wait-for-condition "${msg}" "${condition}" "${OS_WAIT_FOREVER}"
22+
os::util::wait-for-condition "${msg}" "${condition}"
2323

2424
echo "Disabling scheduling for node ${node_name}"
2525
/usr/local/bin/osadm --config="${config}" manage-node "${node_name}" --schedulable=false > /dev/null

images/dind/node/openshift-dind-lib.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,15 @@
1212
# - 1: message indicating what conditions is being waited for (e.g. 'config to be written')
1313
# - 2: a string representing an eval'able condition. When eval'd it should not output
1414
# anything to stdout or stderr.
15-
# - 3: optional timeout in seconds. If not provided, defaults to 60s. If OS_WAIT_FOREVER
16-
# is provided, wait forever.
15+
# - 3: optional timeout in seconds. If not provided, waits forever.
1716
# Returns:
1817
# 1 if the condition is not met before the timeout
19-
readonly OS_WAIT_FOREVER=-1
2018
function os::util::wait-for-condition() {
2119
local msg=$1
2220
# condition should be a string that can be eval'd. When eval'd, it
2321
# should not output anything to stderr or stdout.
2422
local condition=$2
25-
local timeout=${3:-60}
23+
local timeout=${3:-}
2624

2725
local start_msg="Waiting for ${msg}"
2826
local error_msg="[ERROR] Timeout waiting for ${msg}"
@@ -33,10 +31,9 @@ function os::util::wait-for-condition() {
3331
echo "${start_msg}"
3432
fi
3533

36-
if [[ "${counter}" -lt "${timeout}" ||
37-
"${timeout}" = "${OS_WAIT_FOREVER}" ]]; then
34+
if [[ -z "${timeout}" || "${counter}" -lt "${timeout}" ]]; then
3835
counter=$((counter + 1))
39-
if [[ "${timeout}" != "${OS_WAIT_FOREVER}" ]]; then
36+
if [[ -n "${timeout}" ]]; then
4037
echo -n '.'
4138
fi
4239
sleep 1
@@ -46,7 +43,7 @@ function os::util::wait-for-condition() {
4643
fi
4744
done
4845

49-
if [[ "${counter}" != "0" && "${timeout}" != "${OS_WAIT_FOREVER}" ]]; then
46+
if [[ "${counter}" != "0" && -n "${timeout}" ]]; then
5047
echo -e '\nDone'
5148
fi
5249
}

images/dind/node/openshift-enable-ssh-access.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if os::util::is-master; then
1515
else
1616
# Wait for the master to generate the keypair
1717
CONDITION="test -f ${PUBLIC_KEY}"
18-
os::util::wait-for-condition "public key to be generated" "${CONDITION}" "${OS_WAIT_FOREVER}"
18+
os::util::wait-for-condition "public key to be generated" "${CONDITION}"
1919
fi
2020

2121
mkdir -p /root/.ssh

images/dind/node/openshift-generate-node-config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function ensure-node-config() {
3333

3434
# Wait for the master to generate its config
3535
local condition="test -f ${master_config_file}"
36-
os::util::wait-for-condition "admin config" "${condition}" "${OS_WAIT_FOREVER}"
36+
os::util::wait-for-condition "admin config" "${condition}"
3737

3838
local master_host
3939
master_host="$(grep server "${master_config_file}" | grep -v localhost | awk '{print $2}')"

0 commit comments

Comments
 (0)