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
c93fb4e3
Commit
c93fb4e3
authored
Jan 13, 2015
by
Satnam Singh
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3443 from roberthbailey/remove-loop
Remove unnecessary loop.
parents
6f1a3acc
df03cc3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
18 deletions
+9
-18
validate-cluster.sh
cluster/validate-cluster.sh
+9
-18
No files found.
cluster/validate-cluster.sh
View file @
c93fb4e3
...
@@ -33,6 +33,7 @@ detect-master > /dev/null
...
@@ -33,6 +33,7 @@ detect-master > /dev/null
detect-minions
>
/dev/null
detect-minions
>
/dev/null
MINIONS_FILE
=
/tmp/minions
MINIONS_FILE
=
/tmp/minions
# Make several attempts to deal with slow cluster birth.
attempt
=
0
attempt
=
0
while
true
;
do
while
true
;
do
"
${
KUBE_ROOT
}
/cluster/kubectl.sh"
get minions
-o
template
-t
$'{{range.items}}{{.id}}
\n
{{end}}'
>
"
${
MINIONS_FILE
}
"
"
${
KUBE_ROOT
}
/cluster/kubectl.sh"
get minions
-o
template
-t
$'{{range.items}}{{.id}}
\n
{{end}}'
>
"
${
MINIONS_FILE
}
"
...
@@ -57,24 +58,14 @@ fi
...
@@ -57,24 +58,14 @@ fi
for
((
i
=
0
;
i<
${#
MINION_NAMES
[@]
}
;
i++
))
;
do
for
((
i
=
0
;
i<
${#
MINION_NAMES
[@]
}
;
i++
))
;
do
# Grep returns an exit status of 1 when line is not found, so we need the : to always return a 0 exit status
# Grep returns an exit status of 1 when line is not found, so we need the : to always return a 0 exit status
# Make several attempts to deal with slow cluster birth.
count
=
$(
grep
-c
"
${
MINION_NAMES
[
$i
]
}
"
"
${
MINIONS_FILE
}
"
)
||
:
attempt
=
0
if
[[
"
${
count
}
"
==
"0"
]]
;
then
while
true
;
do
echo
-e
"
${
color_red
}
Failed to find
${
MINION_NAMES
[
$i
]
}
, cluster is probably broken.
${
color_norm
}
"
echo
-n
"Attempt
$((
attempt+1
))
to find
${
MINION_NAMES
[
$i
]
}
..."
exit
1
count
=
$(
grep
-c
"
${
MINION_NAMES
[
$i
]
}
"
"
${
MINIONS_FILE
}
"
)
||
:
else
if
[[
"
${
count
}
"
==
"0"
]]
;
then
echo
-e
"
${
color_green
}
[working]
${
color_norm
}
"
if
((
attempt
>
5
))
;
then
break
echo
-e
"
${
color_red
}
Failed to find
${
MINION_NAMES
[
$i
]
}
, cluster is probably broken.
${
color_norm
}
"
fi
exit
1
fi
else
echo
-e
"
${
color_green
}
[working]
${
color_norm
}
"
break
fi
echo
-e
"
${
color_yellow
}
[not working yet]
${
color_norm
}
"
attempt
=
$((
attempt+1
))
sleep
20
done
name
=
"
${
MINION_NAMES
[
$i
]
}
"
name
=
"
${
MINION_NAMES
[
$i
]
}
"
if
[
"
$KUBERNETES_PROVIDER
"
!=
"vsphere"
]
&&
[
"
$KUBERNETES_PROVIDER
"
!=
"vagrant"
]
;
then
if
[
"
$KUBERNETES_PROVIDER
"
!=
"vsphere"
]
&&
[
"
$KUBERNETES_PROVIDER
"
!=
"vagrant"
]
;
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