Avoid connection leaking

An empty transport will by default keep connections alive indefinitely.

Signed-off-by: Daniel Morsing <dmo@jetstack.io>
This commit is contained in:
Daniel Morsing 2019-01-17 14:09:15 +00:00
parent f72b59bee1
commit dc8a4cb95e

View File

@ -157,6 +157,9 @@ func testReachability(ctx context.Context, url string, key string) (bool, error)
// TODO(dmo): figure out if we need to add a more specific timeout for // TODO(dmo): figure out if we need to add a more specific timeout for
// individual checks // individual checks
transport := &http.Transport{ transport := &http.Transport{
// we're only doing 1 request, make the code around this
// simpler by disabling keepalives
DisableKeepAlives: true,
TLSClientConfig: &tls.Config{ TLSClientConfig: &tls.Config{
InsecureSkipVerify: true, InsecureSkipVerify: true,
}, },