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:
Soule BA 2024-05-17 11:57:50 +02:00
parent 7e69f0835b
commit b310a851c7
No known key found for this signature in database
GPG Key ID: 4D40965192802994
1 changed files with 3 additions and 3 deletions

View File

@ -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 != "" {