@@ -40,8 +40,8 @@ import (
40
40
)
41
41
42
42
const (
43
- // ssh port
44
- sshPort = "22"
43
+ // SSHPort is tcp port number of SSH
44
+ SSHPort = "22"
45
45
46
46
// pollNodeInterval is how often to Poll pods.
47
47
pollNodeInterval = 2 * time .Second
@@ -136,7 +136,7 @@ func NodeSSHHosts(c clientset.Interface) ([]string, error) {
136
136
137
137
sshHosts := make ([]string , 0 , len (hosts ))
138
138
for _ , h := range hosts {
139
- sshHosts = append (sshHosts , net .JoinHostPort (h , sshPort ))
139
+ sshHosts = append (sshHosts , net .JoinHostPort (h , SSHPort ))
140
140
}
141
141
return sshHosts , nil
142
142
}
@@ -155,7 +155,7 @@ type Result struct {
155
155
// eg: the name returned by framework.GetMasterHost(). This is also not guaranteed to work across
156
156
// cloud providers since it involves ssh.
157
157
func NodeExec (nodeName , cmd , provider string ) (Result , error ) {
158
- return SSH (cmd , net .JoinHostPort (nodeName , sshPort ), provider )
158
+ return SSH (cmd , net .JoinHostPort (nodeName , SSHPort ), provider )
159
159
}
160
160
161
161
// SSH synchronously SSHs to a node running on provider and runs cmd. If there
@@ -330,7 +330,7 @@ func IssueSSHCommandWithResult(cmd, provider string, node *v1.Node) (*Result, er
330
330
host := ""
331
331
for _ , a := range node .Status .Addresses {
332
332
if a .Type == v1 .NodeExternalIP && a .Address != "" {
333
- host = net .JoinHostPort (a .Address , sshPort )
333
+ host = net .JoinHostPort (a .Address , SSHPort )
334
334
break
335
335
}
336
336
}
@@ -339,7 +339,7 @@ func IssueSSHCommandWithResult(cmd, provider string, node *v1.Node) (*Result, er
339
339
// No external IPs were found, let's try to use internal as plan B
340
340
for _ , a := range node .Status .Addresses {
341
341
if a .Type == v1 .NodeInternalIP && a .Address != "" {
342
- host = net .JoinHostPort (a .Address , sshPort )
342
+ host = net .JoinHostPort (a .Address , SSHPort )
343
343
break
344
344
}
345
345
}
0 commit comments