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
5f4b9198
Unverified
Commit
5f4b9198
authored
Feb 04, 2019
by
Bob Killen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix shellcheck lint errors in test/kubemark/common/util.sh
parent
9a4f4878
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
.shellcheck_failures
hack/.shellcheck_failures
+0
-1
util.sh
test/kubemark/common/util.sh
+7
-2
No files found.
hack/.shellcheck_failures
View file @
5f4b9198
...
@@ -145,7 +145,6 @@
...
@@ -145,7 +145,6 @@
./test/images/volume/rbd/create_block.sh
./test/images/volume/rbd/create_block.sh
./test/images/volume/rbd/mon.sh
./test/images/volume/rbd/mon.sh
./test/images/volume/rbd/osd.sh
./test/images/volume/rbd/osd.sh
./test/kubemark/common/util.sh
./test/kubemark/gce/util.sh
./test/kubemark/gce/util.sh
./test/kubemark/iks/shutdown.sh
./test/kubemark/iks/shutdown.sh
./test/kubemark/iks/startup.sh
./test/kubemark/iks/startup.sh
...
...
test/kubemark/common/util.sh
View file @
5f4b9198
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
# Running cmd $RETRIES times in case of failures.
# Running cmd $RETRIES times in case of failures.
function
run-cmd-with-retries
{
function
run-cmd-with-retries
{
RETRIES
=
"
${
RETRIES
:-
3
}
"
RETRIES
=
"
${
RETRIES
:-
3
}
"
for
attempt
in
$(
seq
1
${
RETRIES
}
)
;
do
for
attempt
in
$(
seq
1
"
${
RETRIES
}
"
)
;
do
local
ret_val
=
0
local
ret_val
=
0
exec
5>&1
# Duplicate &1 to &5 for use below.
exec
5>&1
# Duplicate &1 to &5 for use below.
# We don't use 'local' to declare result as then ret_val always gets value 0.
# We don't use 'local' to declare result as then ret_val always gets value 0.
...
@@ -26,19 +26,24 @@ function run-cmd-with-retries {
...
@@ -26,19 +26,24 @@ function run-cmd-with-retries {
if
[[
"
${
ret_val
:-
0
}
"
-ne
"0"
]]
;
then
if
[[
"
${
ret_val
:-
0
}
"
-ne
"0"
]]
;
then
if
[[
$(
echo
"
${
result
}
"
|
grep
-c
"already exists"
)
-gt
0
]]
;
then
if
[[
$(
echo
"
${
result
}
"
|
grep
-c
"already exists"
)
-gt
0
]]
;
then
if
[[
"
${
attempt
}
"
==
1
]]
;
then
if
[[
"
${
attempt
}
"
==
1
]]
;
then
# shellcheck disable=SC2154 # Color defined in sourced script
echo
-e
"
${
color_red
}
Failed to
$1
$2
${
3
:-}
as the resource hasn't been deleted from a previous run.
${
color_norm
}
"
>
& 2
echo
-e
"
${
color_red
}
Failed to
$1
$2
${
3
:-}
as the resource hasn't been deleted from a previous run.
${
color_norm
}
"
>
& 2
exit
1
exit
1
fi
fi
# shellcheck disable=SC2154 # Color defined in sourced script
echo
-e
"
${
color_yellow
}
Succeeded to
$1
$2
${
3
:-}
in the previous attempt, but status response wasn't received.
${
color_norm
}
"
echo
-e
"
${
color_yellow
}
Succeeded to
$1
$2
${
3
:-}
in the previous attempt, but status response wasn't received.
${
color_norm
}
"
return
0
return
0
fi
fi
# shellcheck disable=SC2154 # Color defined in sourced script
echo
-e
"
${
color_yellow
}
Attempt
$attempt
failed to
$1
$2
${
3
:-}
. Retrying.
${
color_norm
}
"
>
& 2
echo
-e
"
${
color_yellow
}
Attempt
$attempt
failed to
$1
$2
${
3
:-}
. Retrying.
${
color_norm
}
"
>
& 2
sleep
$((
$
attempt
*
5
))
sleep
$((
attempt
*
5
))
else
else
# shellcheck disable=SC2154 # Color defined in sourced script
echo
-e
"
${
color_green
}
Succeeded to
$1
$2
${
3
:-}
.
${
color_norm
}
"
echo
-e
"
${
color_green
}
Succeeded to
$1
$2
${
3
:-}
.
${
color_norm
}
"
return
0
return
0
fi
fi
done
done
# shellcheck disable=SC2154 # Color defined in sourced script
echo
-e
"
${
color_red
}
Failed to
$1
$2
${
3
:-}
.
${
color_norm
}
"
>
& 2
echo
-e
"
${
color_red
}
Failed to
$1
$2
${
3
:-}
.
${
color_norm
}
"
>
& 2
exit
1
exit
1
}
}
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