File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,10 @@ import (
10
10
"github.com/containrrr/watchtower/pkg/registry/manifest"
11
11
"github.com/containrrr/watchtower/pkg/types"
12
12
"github.com/sirupsen/logrus"
13
+ "net"
13
14
"net/http"
14
15
"strings"
16
+ "time"
15
17
)
16
18
17
19
// ContentDigestHeader is the key for the key-value pair containing the digest header
@@ -69,7 +71,17 @@ func TransformAuth(registryAuth string) string {
69
71
// GetDigest from registry using a HEAD request to prevent rate limiting
70
72
func GetDigest (url string , token string ) (string , error ) {
71
73
tr := & http.Transport {
72
- TLSClientConfig : & tls.Config {InsecureSkipVerify : true },
74
+ Proxy : http .ProxyFromEnvironment ,
75
+ DialContext : (& net.Dialer {
76
+ Timeout : 30 * time .Second ,
77
+ KeepAlive : 30 * time .Second ,
78
+ }).DialContext ,
79
+ ForceAttemptHTTP2 : true ,
80
+ MaxIdleConns : 100 ,
81
+ IdleConnTimeout : 90 * time .Second ,
82
+ TLSHandshakeTimeout : 10 * time .Second ,
83
+ ExpectContinueTimeout : 1 * time .Second ,
84
+ TLSClientConfig : & tls.Config {InsecureSkipVerify : true },
73
85
}
74
86
client := & http.Client {Transport : tr }
75
87
You can’t perform that action at this time.
0 commit comments