File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ go 1.23.0
55toolchain go1.24.1
66
77require (
8+ github.com/hashicorp/go-retryablehttp v0.7.7
89 github.com/hashicorp/terraform-plugin-docs v0.19.4
910 github.com/hashicorp/terraform-plugin-framework v1.10.0
1011 github.com/hashicorp/terraform-plugin-framework-validators v0.13.0
Original file line number Diff line number Diff line change @@ -89,6 +89,8 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l
8989github.com/hashicorp/go-multierror v1.1.1 /go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM =
9090github.com/hashicorp/go-plugin v1.6.1 h1:P7MR2UP6gNKGPp+y7EZw2kOiq4IR9WiqLvp0XOsVdwI =
9191github.com/hashicorp/go-plugin v1.6.1 /go.mod h1:XPHFku2tFo3o3QKFgSYo+cghcUhw1NA1hZyMK0PWAw0 =
92+ github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU =
93+ github.com/hashicorp/go-retryablehttp v0.7.7 /go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk =
9294github.com/hashicorp/go-uuid v1.0.0 /go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro =
9395github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8 =
9496github.com/hashicorp/go-uuid v1.0.3 /go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro =
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import (
2727 "time"
2828
2929 "github.com/go-jose/go-jose/v3/jwt"
30+ "github.com/hashicorp/go-retryablehttp"
3031)
3132
3233type Auth struct {
@@ -69,18 +70,22 @@ func NewClient(config Config) *Client {
6970 version = "dev"
7071 }
7172
73+ baseClient := & http.Client {
74+ Timeout : time .Minute ,
75+ Transport : & roundTripper {
76+ userAgent : fmt .Sprintf ("terraform-provider-docker/%s" , version ),
77+ },
78+ }
79+ retryClient := retryablehttp .NewClient ()
80+ retryClient .HTTPClient = baseClient
81+
7282 return & Client {
7383 BaseURL : config .BaseURL ,
7484 auth : Auth {
7585 Username : config .Username ,
7686 Password : config .Password ,
7787 },
78- HTTPClient : & http.Client {
79- Timeout : time .Minute ,
80- Transport : & roundTripper {
81- userAgent : fmt .Sprintf ("terraform-provider-docker/%s" , version ),
82- },
83- },
88+ HTTPClient : retryClient .StandardClient (),
8489 }
8590}
8691
You can’t perform that action at this time.
0 commit comments