Merge pull request #30048 from hashicorp/kmoe/http-backend-debug-log
backend/http: supply logging.LogOutput() to retryable client
This commit is contained in:
commit
8f923cea08
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue