mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Fix goroutine leak in ssh-tunnel healthcheck.
This commit is contained in:
parent
4638f2f355
commit
cba5e84fd1
@ -362,9 +362,13 @@ func (l *SSHTunnelList) healthCheck(e sshTunnelEntry) error {
|
|||||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||||
})
|
})
|
||||||
client := &http.Client{Transport: transport}
|
client := &http.Client{Transport: transport}
|
||||||
_, err := client.Get(l.healthCheckURL.String())
|
resp, err := client.Get(l.healthCheckURL.String())
|
||||||
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
resp.Body.Close()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (l *SSHTunnelList) removeAndReAdd(e sshTunnelEntry) {
|
func (l *SSHTunnelList) removeAndReAdd(e sshTunnelEntry) {
|
||||||
// Find the entry to replace.
|
// Find the entry to replace.
|
||||||
|
Loading…
Reference in New Issue
Block a user