chore: #64 add system hardening with retry logic for client #68

Merged
marcel.henselin merged 4 commits from fix/roundtripper into alpha 2026-02-16 09:35:21 +00:00
Showing only changes of commit c96da0d927 - Show all commits

View file

@ -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