Wait for cluster_info JSON field to be populated (#668)
This commit is contained in:
committed by
tamarrow
parent
ee8d02e24c
commit
68cb480a1f
@@ -14,15 +14,17 @@ while true; do
|
||||
Authorization:"Token ${CCM_AUTH_TOKEN}" | \
|
||||
jq ".status");
|
||||
if [ $STATUS -eq 0 ]; then
|
||||
break;
|
||||
CLUSTER_INFO=$(http GET https://ccm.mesosphere.com/api/cluster/${CLUSTER_ID}/ Authorization:"Token ${CCM_AUTH_TOKEN}" | jq ".cluster_info")
|
||||
|
||||
# # ensure cluster_info is populated
|
||||
if [ ! -z "$CLUSTER_INFO" ]; then
|
||||
eval CLUSTER_INFO=$CLUSTER_INFO # unescape json
|
||||
break;
|
||||
fi;
|
||||
fi;
|
||||
sleep 10;
|
||||
done;
|
||||
|
||||
# get dcos_url
|
||||
CLUSTER_INFO=$(http GET https://ccm.mesosphere.com/api/cluster/${CLUSTER_ID}/ Authorization:"Token ${CCM_AUTH_TOKEN}" | jq ".cluster_info")
|
||||
eval CLUSTER_INFO=$CLUSTER_INFO # unescape json
|
||||
|
||||
DCOS_URL=$(echo "$CLUSTER_INFO" | jq ".MastersIpAddresses[0]")
|
||||
DCOS_URL=${DCOS_URL:1:-1} # remove JSON string quotes
|
||||
echo $DCOS_URL
|
||||
|
||||
Reference in New Issue
Block a user