mirror of https://github.com/docker/cli.git
cli/context/docker: Endpoint.ClientOpts, withHTTPClient: inline variables
Remove some intermediate variables, and inline them. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
6654ea1434
commit
223bf80d4b
|
@ -100,15 +100,13 @@ func (ep *Endpoint) ClientOpts() ([]client.Opt, error) {
|
|||
)
|
||||
|
||||
} else {
|
||||
httpClient := &http.Client{
|
||||
// No tls
|
||||
// No proxy
|
||||
result = append(result,
|
||||
client.WithHTTPClient(&http.Client{
|
||||
// No TLS, and no proxy.
|
||||
Transport: &http.Transport{
|
||||
DialContext: helper.Dialer,
|
||||
},
|
||||
}
|
||||
result = append(result,
|
||||
client.WithHTTPClient(httpClient),
|
||||
}),
|
||||
client.WithHost(helper.Host),
|
||||
client.WithDialContext(helper.Dialer),
|
||||
)
|
||||
|
@ -125,8 +123,7 @@ func withHTTPClient(tlsConfig *tls.Config) func(*client.Client) error {
|
|||
// Use the default HTTPClient
|
||||
return nil
|
||||
}
|
||||
|
||||
httpClient := &http.Client{
|
||||
return client.WithHTTPClient(&http.Client{
|
||||
Transport: &http.Transport{
|
||||
TLSClientConfig: tlsConfig,
|
||||
DialContext: (&net.Dialer{
|
||||
|
@ -135,8 +132,7 @@ func withHTTPClient(tlsConfig *tls.Config) func(*client.Client) error {
|
|||
}).DialContext,
|
||||
},
|
||||
CheckRedirect: client.CheckRedirect,
|
||||
}
|
||||
return client.WithHTTPClient(httpClient)(c)
|
||||
})(c)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue