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:
Soule BA 2024-05-17 11:57:50 +02:00 committed by github-actions[bot]
parent 40ce4b60a0
commit 5e05336b21
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 != "" {