Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
docker-elk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
段孔乐
docker-elk
Commits
7d03e1fc
Unverified
Commit
7d03e1fc
authored
Feb 21, 2021
by
Antoine Cotten
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ci: Avoid unbound integer variable
Fixes #578
parent
f9235f21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
run-tests-metricbeat.sh
.github/workflows/scripts/run-tests-metricbeat.sh
+4
-0
No files found.
.github/workflows/scripts/run-tests-metricbeat.sh
View file @
7d03e1fc
...
@@ -35,7 +35,11 @@ declare -i count
...
@@ -35,7 +35,11 @@ declare -i count
# 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/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
)
"
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'
)
"
count
=
"
$(
jq
-rn
--argjson
data
"
${
response
}
"
'$data.hits.total.value'
)
"
set
-u
if
((
count
>
0
))
;
then
if
((
count
>
0
))
;
then
break
break
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment