UNCLASSIFIED
Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Platform One
Big Bang
P
Packages
Collaboration Tools
mattermost
Commits
bda496ed
Commit
bda496ed
authored
Sep 01, 2021
by
Brendon Lloyd
Browse files
Add script to wait for mattermost custom resources to come up
parent
ba16bc3e
Pipeline
#456545
passed with stages
in 3 minutes and 22 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
tests/wait.sh
tests/wait.sh
+26
-0
No files found.
tests/wait.sh
0 → 100755
View file @
bda496ed
#!/bin/bash
wait_project
()
{
# interval and timeout are in seconds
interval
=
5
timeout
=
600
#
resourcename
=
mattermost
counter
=
0
# need to remove the default "set -e" to allow commands to return nonzero exit codes without the script failing
set
+e
while
true
;
do
if
kubectl get
$resourcename
-o
json
--namespace
=
$resourcename
-o
jsonpath
=
'{.items[0].status.state}'
|
\
grep
"^stable"
1>/dev/null
then
echo
"
$resourcename
custom resource creation finished"
break
fi
sleep
$interval
let
counter++
if
[[
$((
$counter
*
$interval
))
-ge
$timeout
]]
;
then
echo
"
$resourcename
timeout waiting
$timeout
seconds for resource creation"
1>&2
exit
1
fi
done
set
-e
}
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