ci: Avoid unbound integer variable

Fixes #578
This commit is contained in:
Antoine Cotten 2021-02-21 16:15:23 +01:00
parent f9235f2105
commit 7d03e1fc5f
No known key found for this signature in database
GPG Key ID: 94637E68D4A79DD0
1 changed files with 4 additions and 0 deletions

View File

@ -35,7 +35,11 @@ declare -i count
# retry for max 60s (30*2s)
for _ in $(seq 1 30); do
response="$(curl "http://${ip_es}:9200/metricbeat-*/_search?q=agent.type:%22metricbeat%22%20AND%20event.module:%22docker%22%20AND%20event.dataset:%22docker.container%22%20AND%20container.name:%22docker-elk_elasticsearch_1%22&pretty" -s -u elastic:testpasswd)"
set +u # prevent "unbound variable" if assigned value is not an integer
count="$(jq -rn --argjson data "${response}" '$data.hits.total.value')"
set -u
if (( count > 0 )); then
break
fi