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>
(cherry picked from commit b310a851c7
)
This commit is contained in:
parent
40ce4b60a0
commit
5e05336b21
|
@ -69,10 +69,10 @@ func newClient(credentialsFile string, tlsConfig *tls.Config, insecureHTTP bool)
|
|||
opts = append(opts, registry.ClientOptPlainHTTP())
|
||||
}
|
||||
if tlsConfig != nil {
|
||||
t := http.DefaultTransport.(*http.Transport).Clone()
|
||||
t.TLSClientConfig = tlsConfig
|
||||
opts = append(opts, registry.ClientOptHTTPClient(&http.Client{
|
||||
Transport: &http.Transport{
|
||||
TLSClientConfig: tlsConfig,
|
||||
},
|
||||
Transport: t,
|
||||
}))
|
||||
}
|
||||
if credentialsFile != "" {
|
||||
|
|
Loading…
Reference in New Issue