chore: initialize RetryRoundTripper with authentication and retry parameters
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 14s
CI Workflow / CI run tests (pull_request) Failing after 25m58s
CI Workflow / CI run build and linting (pull_request) Successful in 24m3s
CI Workflow / Code coverage report (pull_request) Successful in 5s
CI Workflow / Test readiness for publishing provider (pull_request) Successful in 44m30s
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 14s
CI Workflow / CI run tests (pull_request) Failing after 25m58s
CI Workflow / CI run build and linting (pull_request) Successful in 24m3s
CI Workflow / Code coverage report (pull_request) Successful in 5s
CI Workflow / Test readiness for publishing provider (pull_request) Successful in 44m30s
This commit is contained in:
parent
83cb45b57c
commit
c96da0d927
1 changed files with 10 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
|
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
|
||||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||||
|
|
@ -477,7 +478,7 @@ func (p *Provider) Configure(ctx context.Context, req provider.ConfigureRequest,
|
||||||
providerData.Experiments = experimentValues
|
providerData.Experiments = experimentValues
|
||||||
}
|
}
|
||||||
|
|
||||||
roundTripper, err := sdkauth.SetupAuth(sdkConfig)
|
baseRoundTripper, err := sdkauth.SetupAuth(sdkConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
core.LogAndAddError(
|
core.LogAndAddError(
|
||||||
ctx,
|
ctx,
|
||||||
|
|
@ -488,6 +489,14 @@ func (p *Provider) Configure(ctx context.Context, req provider.ConfigureRequest,
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
roundTripper := core.NewRetryRoundTripper(
|
||||||
|
baseRoundTripper,
|
||||||
|
maxRetries,
|
||||||
|
initialDelay,
|
||||||
|
maxDelay,
|
||||||
|
perTryTimeout,
|
||||||
|
)
|
||||||
|
|
||||||
// Make round tripper and custom endpoints available during DataSource and Resource
|
// Make round tripper and custom endpoints available during DataSource and Resource
|
||||||
// type Configure methods.
|
// type Configure methods.
|
||||||
providerData.RoundTripper = roundTripper
|
providerData.RoundTripper = roundTripper
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue