Skip to content

Commit 7668c52

Browse files
smirafrezbo
authored andcommitted
fix: provide refreshing CA pool (resolvers)
When a registry has _some_ TLS config included, the refreshing CA pool was overwritten with the result returned from the config provider. Ensure that is is restored back to the default value (unless explicitly set by the provider if the registry CA is set). Signed-off-by: Andrey Smirnov <[email protected]> (cherry picked from commit ab84731)
1 parent 511b4d2 commit 7668c52

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/pkg/containers/image/resolver.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ func RegistryHosts(reg config.Registries) docker.RegistryHosts {
6060
if err != nil {
6161
return nil, fmt.Errorf("error preparing TLS config for %q: %w", u.Host, err)
6262
}
63+
64+
// set up refreshing Root CAs if none were provided
65+
if transport.TLSClientConfig.RootCAs == nil {
66+
transport.TLSClientConfig.RootCAs = httpdefaults.RootCAs()
67+
}
6368
}
6469

6570
if u.Path == "" {

0 commit comments

Comments
 (0)