Use the transport pool
If implemented, A transport from the pool with safe defaults will be used when creating an oci registry client. This will enable using the proxy configuration. Signed-off-by: Soule BA <bah.soule@gmail.com>
This commit is contained in:
parent
7e69f0835b
commit
b310a851c7
|
@ -69,10 +69,10 @@ func newClient(credentialsFile string, tlsConfig *tls.Config, insecureHTTP bool)
|
||||||
opts = append(opts, registry.ClientOptPlainHTTP())
|
opts = append(opts, registry.ClientOptPlainHTTP())
|
||||||
}
|
}
|
||||||
if tlsConfig != nil {
|
if tlsConfig != nil {
|
||||||
|
t := http.DefaultTransport.(*http.Transport).Clone()
|
||||||
|
t.TLSClientConfig = tlsConfig
|
||||||
opts = append(opts, registry.ClientOptHTTPClient(&http.Client{
|
opts = append(opts, registry.ClientOptHTTPClient(&http.Client{
|
||||||
Transport: &http.Transport{
|
Transport: t,
|
||||||
TLSClientConfig: tlsConfig,
|
|
||||||
},
|
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
if credentialsFile != "" {
|
if credentialsFile != "" {
|
||||||
|
|
Loading…
Reference in New Issue