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