Skip to content

Commit 6f48c37

Browse files
committed
debug.sh: don't do DNS check if node "name" is an IP address
1 parent 742fe38 commit 6f48c37

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

hack/debug.sh

+9-7
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,18 @@ do_master () {
9292
continue
9393
fi
9494

95-
resolv_ip=$(awk '/\s'$node'$/ { print $1; exit; }' /etc/hosts)
96-
if [ -z "$resolv_ip" ]; then
97-
resolv_ip=$(host $node 2>/dev/null | sed -ne 's/.*has address //p' | head -1)
95+
if ! [[ $node =~ ^[0-9.]*$ ]]; then
96+
resolv_ip=$(awk '/\s'$node'$/ { print $1; exit; }' /etc/hosts)
9897
if [ -z "$resolv_ip" ]; then
99-
echo "Node $node: no IP address in either DNS or /etc/hosts"
98+
resolv_ip=$(host $node 2>/dev/null | sed -ne 's/.*has address //p' | head -1)
99+
if [ -z "$resolv_ip" ]; then
100+
echo "Node $node: no IP address in either DNS or /etc/hosts"
101+
fi
100102
fi
101-
fi
102103

103-
if [ "$reg_ip" != "$resolv_ip" ]; then
104-
echo "Node $node: the IP in OpenShift ($reg_ip) does not match DNS/hosts ($resolv_ip)"
104+
if [ "$reg_ip" != "$resolv_ip" ]; then
105+
echo "Node $node: the IP in OpenShift ($reg_ip) does not match DNS/hosts ($resolv_ip)"
106+
fi
105107
fi
106108

107109
try_eval ping -c1 -W2 $node

0 commit comments

Comments
 (0)