Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
Jacklull
k3s
Commits
0759289d
Commit
0759289d
authored
May 09, 2017
by
Shyam Jeedigunta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stream output of run-gcloud-compute-with-retries to stdout in realtime
parent
2e800eef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
util.sh
test/kubemark/gce/util.sh
+3
-1
No files found.
test/kubemark/gce/util.sh
View file @
0759289d
...
@@ -20,8 +20,10 @@
...
@@ -20,8 +20,10 @@
function
run-gcloud-compute-with-retries
{
function
run-gcloud-compute-with-retries
{
RETRIES
=
"
${
RETRIES
:-
3
}
"
RETRIES
=
"
${
RETRIES
:-
3
}
"
for
attempt
in
$(
seq
1
${
RETRIES
})
;
do
for
attempt
in
$(
seq
1
${
RETRIES
})
;
do
exec
5>&1
# Duplicate &1 to &5 for use below.
# We don't use 'local' to declare gcloud_result as then ret_val always gets value 0.
# We don't use 'local' to declare gcloud_result as then ret_val always gets value 0.
gcloud_result
=
$(
gcloud compute
"
$@
"
2>&1
)
||
local
ret_val
=
"
$?
"
# We use tee to output to &5 (redirected to stdout) while also storing it in the variable.
gcloud_result
=
$(
gcloud compute
"
$@
"
|&
tee
>(
cat
-
>
&5
)
)
||
local
ret_val
=
"
$?
"
echo
"
${
gcloud_result
}
"
echo
"
${
gcloud_result
}
"
if
[[
"
${
ret_val
:-
0
}
"
-ne
"0"
]]
;
then
if
[[
"
${
ret_val
:-
0
}
"
-ne
"0"
]]
;
then
if
[[
$(
echo
"
${
gcloud_result
}
"
|
grep
-c
"already exists"
)
-gt
0
]]
;
then
if
[[
$(
echo
"
${
gcloud_result
}
"
|
grep
-c
"already exists"
)
-gt
0
]]
;
then
...
...
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