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
41c75969
Commit
41c75969
authored
Jan 11, 2018
by
Lantao Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use linux commands instead of docker commands.
parent
7a58a5ca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
util.go
test/e2e/framework/util.go
+6
-8
No files found.
test/e2e/framework/util.go
View file @
41c75969
...
@@ -3900,9 +3900,7 @@ func sshRestartMaster() error {
...
@@ -3900,9 +3900,7 @@ func sshRestartMaster() error {
}
}
var
command
string
var
command
string
if
ProviderIs
(
"gce"
)
{
if
ProviderIs
(
"gce"
)
{
// `kube-apiserver_kube-apiserver` matches the name of the apiserver
command
=
"pidof kube-apiserver | xargs sudo kill"
// container.
command
=
"sudo docker ps | grep kube-apiserver_kube-apiserver | cut -d ' ' -f 1 | xargs sudo docker kill"
}
else
{
}
else
{
command
=
"sudo /etc/init.d/kube-apiserver restart"
command
=
"sudo /etc/init.d/kube-apiserver restart"
}
}
...
@@ -3933,9 +3931,9 @@ func RestartControllerManager() error {
...
@@ -3933,9 +3931,9 @@ func RestartControllerManager() error {
if
ProviderIs
(
"gce"
)
&&
!
MasterOSDistroIs
(
"gci"
)
{
if
ProviderIs
(
"gce"
)
&&
!
MasterOSDistroIs
(
"gci"
)
{
return
fmt
.
Errorf
(
"unsupported master OS distro: %s"
,
TestContext
.
MasterOSDistro
)
return
fmt
.
Errorf
(
"unsupported master OS distro: %s"
,
TestContext
.
MasterOSDistro
)
}
}
cmd
:=
"
sudo docker ps | grep k8s_kube-controller-manager | cut -d ' ' -f 1 | xargs sudo docker
kill"
cmd
:=
"
pidof kube-controller-manager | xargs sudo
kill"
Logf
(
"Restarting controller-manager via ssh, running: %v"
,
cmd
)
Logf
(
"Restarting controller-manager via ssh, running: %v"
,
cmd
)
result
,
err
:=
SSH
(
cmd
,
GetMasterHost
()
+
":22"
,
TestContext
.
Provider
)
result
,
err
:=
SSH
(
cmd
,
net
.
JoinHostPort
(
GetMasterHost
(),
sshPort
)
,
TestContext
.
Provider
)
if
err
!=
nil
||
result
.
Code
!=
0
{
if
err
!=
nil
||
result
.
Code
!=
0
{
LogSSHResult
(
result
)
LogSSHResult
(
result
)
return
fmt
.
Errorf
(
"couldn't restart controller-manager: %v"
,
err
)
return
fmt
.
Errorf
(
"couldn't restart controller-manager: %v"
,
err
)
...
@@ -3946,7 +3944,7 @@ func RestartControllerManager() error {
...
@@ -3946,7 +3944,7 @@ func RestartControllerManager() error {
func
WaitForControllerManagerUp
()
error
{
func
WaitForControllerManagerUp
()
error
{
cmd
:=
"curl http://localhost:"
+
strconv
.
Itoa
(
ports
.
ControllerManagerPort
)
+
"/healthz"
cmd
:=
"curl http://localhost:"
+
strconv
.
Itoa
(
ports
.
ControllerManagerPort
)
+
"/healthz"
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
time
.
Minute
;
time
.
Sleep
(
5
*
time
.
Second
)
{
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
time
.
Minute
;
time
.
Sleep
(
5
*
time
.
Second
)
{
result
,
err
:=
SSH
(
cmd
,
GetMasterHost
()
+
":22"
,
TestContext
.
Provider
)
result
,
err
:=
SSH
(
cmd
,
net
.
JoinHostPort
(
GetMasterHost
(),
sshPort
)
,
TestContext
.
Provider
)
if
err
!=
nil
||
result
.
Code
!=
0
{
if
err
!=
nil
||
result
.
Code
!=
0
{
LogSSHResult
(
result
)
LogSSHResult
(
result
)
}
}
...
@@ -3960,9 +3958,9 @@ func WaitForControllerManagerUp() error {
...
@@ -3960,9 +3958,9 @@ func WaitForControllerManagerUp() error {
// CheckForControllerManagerHealthy checks that the controller manager does not crash within "duration"
// CheckForControllerManagerHealthy checks that the controller manager does not crash within "duration"
func
CheckForControllerManagerHealthy
(
duration
time
.
Duration
)
error
{
func
CheckForControllerManagerHealthy
(
duration
time
.
Duration
)
error
{
var
PID
string
var
PID
string
cmd
:=
"
sudo docker ps | grep k8s_kube-controller-manager | cut -d ' ' -f 1
"
cmd
:=
"
pidof kube-controller-manager
"
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
duration
;
time
.
Sleep
(
5
*
time
.
Second
)
{
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
duration
;
time
.
Sleep
(
5
*
time
.
Second
)
{
result
,
err
:=
SSH
(
cmd
,
GetMasterHost
()
+
":22"
,
TestContext
.
Provider
)
result
,
err
:=
SSH
(
cmd
,
net
.
JoinHostPort
(
GetMasterHost
(),
sshPort
)
,
TestContext
.
Provider
)
if
err
!=
nil
{
if
err
!=
nil
{
// We don't necessarily know that it crashed, pipe could just be broken
// We don't necessarily know that it crashed, pipe could just be broken
LogSSHResult
(
result
)
LogSSHResult
(
result
)
...
...
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