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
8cd105a4
Commit
8cd105a4
authored
Mar 13, 2015
by
Lénaïc Huard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement ssh-to-node and restart-* functions in libvirt-coreos
in order to make the service.sh e2e test pass.
parent
c03b0803
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
util.sh
cluster/libvirt-coreos/util.sh
+34
-0
No files found.
cluster/libvirt-coreos/util.sh
View file @
8cd105a4
...
...
@@ -286,6 +286,40 @@ function get-password {
echo
"TODO get-password"
}
# SSH to a node by name or IP ($1) and run a command ($2).
function
ssh-to-node
{
local
node
=
"
$1
"
local
cmd
=
"
$2
"
local
machine
if
[[
"
$node
"
==
"
$MASTER_IP
"
]]
||
[[
"
$node
"
=
~ ^
"
$MINION_IP_BASE
"
]]
;
then
machine
=
"
$node
"
elif
[[
"
$node
"
==
"
$MASTER_NAME
"
]]
;
then
machine
=
"
$MASTER_IP
"
else
for
((
i
=
0
;
i < NUM_MINIONS
;
i++
))
;
do
if
[[
"
$node
"
==
"
${
MINION_NAMES
[
$i
]
}
"
]]
;
then
machine
=
"
${
MINION_IPS
[
$i
]
}
"
break
fi
done
fi
if
[[
-z
"
$machine
"
]]
;
then
echo
"
$node
is an unknown machine to ssh to"
>
&2
fi
ssh
-o
StrictHostKeyChecking
=
no
-o
UserKnownHostsFile
=
/dev/null
-o
ControlMaster
=
no
"core@
$machine
"
"
$cmd
"
}
# Restart the kube-proxy on a node ($1)
function
restart-kube-proxy
{
ssh-to-node
"
$1
"
"sudo systemctl restart kube-proxy"
}
# Restart the apiserver
function
restart-apiserver
{
ssh-to-node
"
$1
"
"sudo systemctl restart kube-apiserver"
}
# Perform preparations required to run e2e tests
function
prepare-e2e
()
{
echo
"libvirt-coreos doesn't need special preparations for e2e tests"
1>&2
...
...
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