mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Don't leak ssh connections
Without this fix, the underlying network connection is never closed.
This commit is contained in:
parent
fd66d37b3a
commit
4d3db1873f
@ -190,6 +190,7 @@ func runSSHCommand(dialer sshDialer, cmd, user, host string, signer ssh.Signer,
|
||||
if err != nil {
|
||||
return "", "", 0, fmt.Errorf("error getting SSH client to %s@%s: '%v'", user, host, err)
|
||||
}
|
||||
defer client.Close()
|
||||
session, err := client.NewSession()
|
||||
if err != nil {
|
||||
return "", "", 0, fmt.Errorf("error creating session to %s@%s: '%v'", user, host, err)
|
||||
|
Loading…
Reference in New Issue
Block a user