mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
Add util to set transport defaults
This commit is contained in:
@@ -380,15 +380,9 @@ func tlsTransportFor(config *Config) (http.RoundTripper, error) {
|
||||
}
|
||||
|
||||
// Cache a single transport for these options
|
||||
tlsTransports[key] = &http.Transport{
|
||||
tlsTransports[key] = util.SetTransportDefaults(&http.Transport{
|
||||
TLSClientConfig: tlsConfig,
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
Dial: (&net.Dialer{
|
||||
Timeout: 30 * time.Second,
|
||||
KeepAlive: 30 * time.Second,
|
||||
}).Dial,
|
||||
TLSHandshakeTimeout: 10 * time.Second,
|
||||
}
|
||||
})
|
||||
return tlsTransports[key], nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user