Skip to content

Commit 610a1d1

Browse files
committed
fix golint failures of e2e/framework/ssh.go, e2e/framework/size.go
1 parent 1b71126 commit 610a1d1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

test/e2e/framework/size.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const (
2626
resizeNodeNotReadyTimeout = 2 * time.Minute
2727
)
2828

29+
// ResizeGroup resizes an instance group
2930
func ResizeGroup(group string, size int32) error {
3031
if TestContext.ReportDir != "" {
3132
CoreDump(TestContext.ReportDir)
@@ -34,14 +35,17 @@ func ResizeGroup(group string, size int32) error {
3435
return TestContext.CloudConfig.Provider.ResizeGroup(group, size)
3536
}
3637

38+
// GetGroupNodes returns a node name for the specified node group
3739
func GetGroupNodes(group string) ([]string, error) {
3840
return TestContext.CloudConfig.Provider.GetGroupNodes(group)
3941
}
4042

43+
// GroupSize returns the size of an instance group
4144
func GroupSize(group string) (int, error) {
4245
return TestContext.CloudConfig.Provider.GroupSize(group)
4346
}
4447

48+
// WaitForGroupSize waits for node instance group reached the desired size
4549
func WaitForGroupSize(group string, size int32) error {
4650
timeout := 30 * time.Minute
4751
for start := time.Now(); time.Since(start) < timeout; time.Sleep(20 * time.Second) {

test/e2e/framework/ssh.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ func NodeSSHHosts(c clientset.Interface) ([]string, error) {
111111
return sshHosts, nil
112112
}
113113

114+
// SSHResult holds the execution result of SSH command
114115
type SSHResult struct {
115116
User string
116117
Host string
@@ -230,6 +231,7 @@ func RunSSHCommandViaBastion(cmd, user, bastion, host string, signer ssh.Signer)
230231
return bout.String(), berr.String(), code, err
231232
}
232233

234+
// LogSSHResult records SSHResult log
233235
func LogSSHResult(result SSHResult) {
234236
remote := fmt.Sprintf("%s@%s", result.User, result.Host)
235237
Logf("ssh %s: command: %s", remote, result.Cmd)
@@ -238,6 +240,7 @@ func LogSSHResult(result SSHResult) {
238240
Logf("ssh %s: exit code: %d", remote, result.Code)
239241
}
240242

243+
// IssueSSHCommandWithResult tries to execute a SSH command and returns the execution result
241244
func IssueSSHCommandWithResult(cmd, provider string, node *v1.Node) (*SSHResult, error) {
242245
Logf("Getting external IP address for %s", node.Name)
243246
host := ""
@@ -274,6 +277,7 @@ func IssueSSHCommandWithResult(cmd, provider string, node *v1.Node) (*SSHResult,
274277
return &result, nil
275278
}
276279

280+
// IssueSSHCommand tries to execute a SSH command
277281
func IssueSSHCommand(cmd, provider string, node *v1.Node) error {
278282
_, err := IssueSSHCommandWithResult(cmd, provider, node)
279283
if err != nil {

0 commit comments

Comments
 (0)