pass hclog logger to retryable client

This commit is contained in:
Katy Moe 2021-11-29 23:45:35 +00:00
parent b5af7b6c92
commit b1c071bb57
No known key found for this signature in database
GPG Key ID: 8C3780F6DCDDA885
1 changed files with 3 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import (
"context" "context"
"crypto/tls" "crypto/tls"
"fmt" "fmt"
"log"
"net/http" "net/http"
"net/url" "net/url"
"time" "time"
@ -12,6 +13,7 @@ import (
"github.com/hashicorp/go-retryablehttp" "github.com/hashicorp/go-retryablehttp"
"github.com/hashicorp/terraform/internal/backend" "github.com/hashicorp/terraform/internal/backend"
"github.com/hashicorp/terraform/internal/legacy/helper/schema" "github.com/hashicorp/terraform/internal/legacy/helper/schema"
"github.com/hashicorp/terraform/internal/logging"
"github.com/hashicorp/terraform/internal/states/remote" "github.com/hashicorp/terraform/internal/states/remote"
"github.com/hashicorp/terraform/internal/states/statemgr" "github.com/hashicorp/terraform/internal/states/statemgr"
) )
@ -161,6 +163,7 @@ func (b *Backend) configure(ctx context.Context) error {
rClient.RetryMax = data.Get("retry_max").(int) rClient.RetryMax = data.Get("retry_max").(int)
rClient.RetryWaitMin = time.Duration(data.Get("retry_wait_min").(int)) * time.Second rClient.RetryWaitMin = time.Duration(data.Get("retry_wait_min").(int)) * time.Second
rClient.RetryWaitMax = time.Duration(data.Get("retry_wait_max").(int)) * time.Second rClient.RetryWaitMax = time.Duration(data.Get("retry_wait_max").(int)) * time.Second
rClient.Logger = log.New(logging.LogOutput(), "", log.Flags())
b.client = &httpClient{ b.client = &httpClient{
URL: updateURL, URL: updateURL,