Skip to content

Commit

Permalink
dind: only wait for Ready non-sdn nodes
Browse files Browse the repository at this point in the history
The 'wait-for-cluster' command of hack/dind-cluster.sh was previously
evaluating all nodes when determining whether the cluster's nodes were
seen to be 'Ready' and not excluding 'NotReady'.  The command now
excludes the sdn node, whose state is not relevant for determining
cluster readiness, and ensures that NotReady nodes are properly
excluded.
  • Loading branch information
marun committed Apr 13, 2016
1 parent e8b48d9 commit d7df840
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
9 changes: 5 additions & 4 deletions hack/dind-cluster.sh
Expand Up @@ -324,11 +324,12 @@ os::provision::install-cmds ${DEPLOYED_ROOT}"
}

function nodes-are-ready() {
local node_count=$(${DOCKER_CMD} exec -t "${MASTER_NAME}" bash -c "\
# Skip the SDN node since nothing is intended to be scheduled on it.
local node_count=$(${DOCKER_CMD} exec -t "${MASTER_NAME}" bash -c "\
KUBECONFIG=${DEPLOYED_CONFIG_ROOT}/openshift.local.config/master/admin.kubeconfig \
oc get nodes | grep Ready | wc -l")
node_count=$(echo "${node_count}" | tr -d '\r')
test "${node_count}" -ge "${NODE_COUNT}"
oc get nodes | grep -v ${SDN_NODE_NAME} | grep -v NotReady | grep Ready | wc -l")
node_count=$(echo "${node_count}" | tr -d '\r')
test "${node_count}" -ge "${NODE_COUNT}"
}

function wait-for-cluster() {
Expand Down
23 changes: 23 additions & 0 deletions hack/testme.sh
@@ -0,0 +1,23 @@
#!/bin/bash

set -o errexit
set -o pipefail

function foo() {
local my_file=$1
echo "running ${my_file}"
return 1
}

function cleanup() {
echo 'error! cleaning up'
}

trap "exit" INT TERM
trap "cleanup" EXIT

foo /bar
foo /tmp || true


echo $(basename ${BASH_SOURCE})

0 comments on commit d7df840

Please sign in to comment.