@@ -111,6 +111,7 @@ func NodeSSHHosts(c clientset.Interface) ([]string, error) {
111
111
return sshHosts , nil
112
112
}
113
113
114
+ // SSHResult holds the execution result of SSH command
114
115
type SSHResult struct {
115
116
User string
116
117
Host string
@@ -230,6 +231,7 @@ func RunSSHCommandViaBastion(cmd, user, bastion, host string, signer ssh.Signer)
230
231
return bout .String (), berr .String (), code , err
231
232
}
232
233
234
+ // LogSSHResult records SSHResult log
233
235
func LogSSHResult (result SSHResult ) {
234
236
remote := fmt .Sprintf ("%s@%s" , result .User , result .Host )
235
237
Logf ("ssh %s: command: %s" , remote , result .Cmd )
@@ -238,6 +240,7 @@ func LogSSHResult(result SSHResult) {
238
240
Logf ("ssh %s: exit code: %d" , remote , result .Code )
239
241
}
240
242
243
+ // IssueSSHCommandWithResult tries to execute a SSH command and returns the execution result
241
244
func IssueSSHCommandWithResult (cmd , provider string , node * v1.Node ) (* SSHResult , error ) {
242
245
Logf ("Getting external IP address for %s" , node .Name )
243
246
host := ""
@@ -274,6 +277,7 @@ func IssueSSHCommandWithResult(cmd, provider string, node *v1.Node) (*SSHResult,
274
277
return & result , nil
275
278
}
276
279
280
+ // IssueSSHCommand tries to execute a SSH command
277
281
func IssueSSHCommand (cmd , provider string , node * v1.Node ) error {
278
282
_ , err := IssueSSHCommandWithResult (cmd , provider , node )
279
283
if err != nil {
0 commit comments