Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit 2208d8b

Browse files
authored
Merge pull request #1758 from grafana/only-add-peers-with-non-null-ip-address
only connect to peers that have non-null ip address. fix #683
2 parents 486c340 + c19b35a commit 2208d8b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/k8s/entrypoint.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,13 @@ if [ ! -z "$LABEL_SELECTOR" ]; then
5656

5757
_PODS=$(curl -s $CA -H "$AUTH" $PROTO://${HOST}:${PORT}/api/v1/namespaces/${POD_NAMESPACE}/pods?labelSelector=$LABEL_SELECTOR|jq .items[].status.podIP|sed -e "s/\"//g")
5858
LIST=
59+
5960
for server in $_PODS; do
60-
LIST="${LIST}$server,"
61+
if [ "$server" != "null" ] ; then
62+
LIST="${LIST}$server,"
63+
fi
6164
done
65+
6266
export MT_CLUSTER_PEERS=$(echo $LIST | sed 's/,$//')
6367
fi
6468

0 commit comments

Comments
 (0)