chore: #64 add system hardening with retry logic for client #68
1 changed files with 10 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
|
|
@ -477,7 +478,7 @@ func (p *Provider) Configure(ctx context.Context, req provider.ConfigureRequest,
|
|||
providerData.Experiments = experimentValues
|
||||
}
|
||||
|
||||
roundTripper, err := sdkauth.SetupAuth(sdkConfig)
|
||||
baseRoundTripper, err := sdkauth.SetupAuth(sdkConfig)
|
||||
if err != nil {
|
||||
core.LogAndAddError(
|
||||
ctx,
|
||||
|
|
@ -488,6 +489,14 @@ func (p *Provider) Configure(ctx context.Context, req provider.ConfigureRequest,
|
|||
return
|
||||
}
|
||||
|
||||
roundTripper := core.NewRetryRoundTripper(
|
||||
baseRoundTripper,
|
||||
maxRetries,
|
||||
initialDelay,
|
||||
maxDelay,
|
||||
perTryTimeout,
|
||||
)
|
||||
|
||||
// Make round tripper and custom endpoints available during DataSource and Resource
|
||||
// type Configure methods.
|
||||
providerData.RoundTripper = roundTripper
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue