fix(ci): Image names with underscores in search queries

GitHub updated their Ubuntu 22.04 runner image to 20220821.1, which
bumped Compose from v2.6.1 to v2.9.0.
Compose v2.8.0 introduced a breaking change where the name of certain
resources — such as images — are created with hyphens '-' instead of
underscores '_'.

Ref. https://docs.docker.com/compose/release-notes/#280
This commit is contained in:
Antoine Cotten 2022-08-25 11:11:35 +02:00
parent fff0c8fc98
commit 52df39e3cc
No known key found for this signature in database
GPG Key ID: 94637E68D4A79DD0
1 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ poll_ready "$cid_lsp" "http://${ip_lsp}/health"
# 2021/01/07 16:14:52 # logspout v3.2.13-custom by gliderlabs # 2021/01/07 16:14:52 # logspout v3.2.13-custom by gliderlabs
# #
# which we expect to find by querying: # which we expect to find by querying:
# docker.image:"docker-elk_logspout" AND message:"logspout gliderlabs"~3 # docker.image:"docker-elk-logspout" AND message:"logspout gliderlabs"~3
# #
log 'Searching a log entry forwarded by Logspout' log 'Searching a log entry forwarded by Logspout'
@ -39,7 +39,7 @@ declare -i was_retried=0
# retry for max 60s (30*2s) # retry for max 60s (30*2s)
for _ in $(seq 1 30); do for _ in $(seq 1 30); do
response="$(curl "http://${ip_es}:9200/logs-generic-default/_search?q=docker.image:%22docker-elk_logspout%22%20AND%20message:%22logspout%20gliderlabs%22~3&pretty" -s -u elastic:testpasswd)" response="$(curl "http://${ip_es}:9200/logs-generic-default/_search?q=docker.image:%22docker-elk-logspout%22%20AND%20message:%22logspout%20gliderlabs%22~3&pretty" -s -u elastic:testpasswd)"
set +u # prevent "unbound variable" if assigned value is not an integer set +u # prevent "unbound variable" if assigned value is not an integer
count="$(jq -rn --argjson data "${response}" '$data.hits.total.value')" count="$(jq -rn --argjson data "${response}" '$data.hits.total.value')"