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
d0c0883a
Unverified
Commit
d0c0883a
authored
Mar 31, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Mar 31, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #75923 from SataQiu/fix-golint-ssh-size-20190331
Fix golint failures of e2e/framework/ssh.go, e2e/framework/size.go
parents
1b711267
610a1d1b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
size.go
test/e2e/framework/size.go
+4
-0
ssh.go
test/e2e/framework/ssh.go
+4
-0
No files found.
test/e2e/framework/size.go
View file @
d0c0883a
...
...
@@ -26,6 +26,7 @@ const (
resizeNodeNotReadyTimeout
=
2
*
time
.
Minute
)
// ResizeGroup resizes an instance group
func
ResizeGroup
(
group
string
,
size
int32
)
error
{
if
TestContext
.
ReportDir
!=
""
{
CoreDump
(
TestContext
.
ReportDir
)
...
...
@@ -34,14 +35,17 @@ func ResizeGroup(group string, size int32) error {
return
TestContext
.
CloudConfig
.
Provider
.
ResizeGroup
(
group
,
size
)
}
// GetGroupNodes returns a node name for the specified node group
func
GetGroupNodes
(
group
string
)
([]
string
,
error
)
{
return
TestContext
.
CloudConfig
.
Provider
.
GetGroupNodes
(
group
)
}
// GroupSize returns the size of an instance group
func
GroupSize
(
group
string
)
(
int
,
error
)
{
return
TestContext
.
CloudConfig
.
Provider
.
GroupSize
(
group
)
}
// WaitForGroupSize waits for node instance group reached the desired size
func
WaitForGroupSize
(
group
string
,
size
int32
)
error
{
timeout
:=
30
*
time
.
Minute
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
timeout
;
time
.
Sleep
(
20
*
time
.
Second
)
{
...
...
test/e2e/framework/ssh.go
View file @
d0c0883a
...
...
@@ -111,6 +111,7 @@ func NodeSSHHosts(c clientset.Interface) ([]string, error) {
return
sshHosts
,
nil
}
// SSHResult holds the execution result of SSH command
type
SSHResult
struct
{
User
string
Host
string
...
...
@@ -230,6 +231,7 @@ func RunSSHCommandViaBastion(cmd, user, bastion, host string, signer ssh.Signer)
return
bout
.
String
(),
berr
.
String
(),
code
,
err
}
// LogSSHResult records SSHResult log
func
LogSSHResult
(
result
SSHResult
)
{
remote
:=
fmt
.
Sprintf
(
"%s@%s"
,
result
.
User
,
result
.
Host
)
Logf
(
"ssh %s: command: %s"
,
remote
,
result
.
Cmd
)
...
...
@@ -238,6 +240,7 @@ func LogSSHResult(result SSHResult) {
Logf
(
"ssh %s: exit code: %d"
,
remote
,
result
.
Code
)
}
// IssueSSHCommandWithResult tries to execute a SSH command and returns the execution result
func
IssueSSHCommandWithResult
(
cmd
,
provider
string
,
node
*
v1
.
Node
)
(
*
SSHResult
,
error
)
{
Logf
(
"Getting external IP address for %s"
,
node
.
Name
)
host
:=
""
...
...
@@ -274,6 +277,7 @@ func IssueSSHCommandWithResult(cmd, provider string, node *v1.Node) (*SSHResult,
return
&
result
,
nil
}
// IssueSSHCommand tries to execute a SSH command
func
IssueSSHCommand
(
cmd
,
provider
string
,
node
*
v1
.
Node
)
error
{
_
,
err
:=
IssueSSHCommandWithResult
(
cmd
,
provider
,
node
)
if
err
!=
nil
{
...
...
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