From 2ba5978a6eed95e622fcc50d8355e1fa8359e698 Mon Sep 17 00:00:00 2001 From: Tom Bamford Date: Thu, 14 Mar 2024 11:44:12 +0000 Subject: [PATCH] dependencies: updating to v0.20240314.1083835 of `github.com/hashicorp/go-azure-sdk` --- go.mod | 2 +- go.sum | 4 ++-- .../go-azure-sdk/sdk/client/pollers/poller.go | 4 ++-- .../sdk/client/resourcemanager/poller_lro.go | 17 ++++++++++++++--- vendor/modules.txt | 2 +- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 350f76b248bd..f1dcf585ae01 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/google/uuid v1.4.0 github.com/hashicorp/go-azure-helpers v0.66.2 github.com/hashicorp/go-azure-sdk/resource-manager v0.20240229.1102109 - github.com/hashicorp/go-azure-sdk/sdk v0.20240229.1102109 + github.com/hashicorp/go-azure-sdk/sdk v0.20240314.1083835 github.com/hashicorp/go-hclog v1.5.0 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-uuid v1.0.3 diff --git a/go.sum b/go.sum index d9db26cc608f..cf3b09b55ba1 100644 --- a/go.sum +++ b/go.sum @@ -97,8 +97,8 @@ github.com/hashicorp/go-azure-helpers v0.66.2 h1:+Pzuo7pdKl0hBXXr5ymmhs4Q40tHAo2 github.com/hashicorp/go-azure-helpers v0.66.2/go.mod h1:kJxXrFtJKJdOEqvad8pllAe7dhP4DbN8J6sqFZe47+4= github.com/hashicorp/go-azure-sdk/resource-manager v0.20240229.1102109 h1:3e4ceMmTqM2upGPdGlEynSqx1tLbQ8qzRVdzVllxp0U= github.com/hashicorp/go-azure-sdk/resource-manager v0.20240229.1102109/go.mod h1:SnoGTze4MqMaUcNRZVtWGXlUcP5lOd7bTR1IBwToJNQ= -github.com/hashicorp/go-azure-sdk/sdk v0.20240229.1102109 h1:YoJNkpL7JV1FWVRkO0zXr7ULyuRrRZeWrQKHV2Kljdo= -github.com/hashicorp/go-azure-sdk/sdk v0.20240229.1102109/go.mod h1:IKIPyL+hfFWBHABKT0NOWlIEzlusiUBG0SxIfaiv278= +github.com/hashicorp/go-azure-sdk/sdk v0.20240314.1083835 h1:KDewpfRBRnLGd0p6K9XYNQbv9syNFiek3hOPBxt3Gj4= +github.com/hashicorp/go-azure-sdk/sdk v0.20240314.1083835/go.mod h1:POOjeoqNp+mvlLBuibJTziUAkBZ7FxXGeGestwemL/w= github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= diff --git a/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/pollers/poller.go b/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/pollers/poller.go index d468fa5f0f55..1601d28dcc88 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/pollers/poller.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/pollers/poller.go @@ -108,7 +108,7 @@ func (p *Poller) PollUntilDone(ctx context.Context) error { go func() { connectionDropCounter := 0 retryDuration := p.initialDelayDuration - for true { + for { // determine the next retry duration / how long to poll for if p.latestResponse != nil { retryDuration = p.latestResponse.PollInterval @@ -129,7 +129,7 @@ func (p *Poller) PollUntilDone(ctx context.Context) error { // connection drops can either have no response/error (where we have no context) connectionHasBeenDropped = true } else if _, ok := p.latestError.(PollingDroppedConnectionError); ok { - // or have an error with more details (e.g. server not found, connection reset etc) + // or have an error with more details (e.g. server not found, connection reset etc.) connectionHasBeenDropped = true } if connectionHasBeenDropped { diff --git a/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager/poller_lro.go b/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager/poller_lro.go index 3876b7b11a7e..254bb9913a2b 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager/poller_lro.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager/poller_lro.go @@ -15,8 +15,10 @@ import ( "strings" "time" + "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-sdk/sdk/client" "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/odata" ) var _ pollers.PollerType = &longRunningOperationPoller{} @@ -77,6 +79,14 @@ func (p *longRunningOperationPoller) Poll(ctx context.Context) (result *pollers. return nil, fmt.Errorf("internal error: cannot poll without a pollingUrl") } + // Retry the polling operation if a 404 was returned + retryOn404 := func(resp *http.Response, _ *odata.OData) (bool, error) { + if resp != nil && response.WasStatusCode(resp, http.StatusNotFound) { + return true, nil + } + return false, nil + } + reqOpts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -88,6 +98,7 @@ func (p *longRunningOperationPoller) Poll(ctx context.Context) (result *pollers. HttpMethod: http.MethodGet, OptionsObject: nil, Path: p.pollingUrl.Path, + RetryFunc: client.RequestRetryAny(append(defaultRetryFunctions, retryOn404)...), } // TODO: port over the `api-version` header @@ -98,9 +109,6 @@ func (p *longRunningOperationPoller) Poll(ctx context.Context) (result *pollers. } req.URL.RawQuery = p.pollingUrl.RawQuery - // Custom RetryFunc to inspect the operation payload and check the status - req.RetryFunc = client.RequestRetryAny(defaultRetryFunctions...) - result = &pollers.PollResult{ PollInterval: p.initialRetryDuration, } @@ -186,6 +194,9 @@ func (p *longRunningOperationPoller) Poll(ctx context.Context) (result *pollers. // ContainerRegistry@2019-06-01-preview returns `Creating` rather than `InProgress` during creation "Creating": pollers.PollingStatusInProgress, + // CosmosDB @ 2023-04-15 returns `Dequeued` rather than `InProgress` during creation/update + "Dequeued": pollers.PollingStatusInProgress, + // StorageSync@2020-03-01 returns `finishNewStorageSyncService` rather than `InProgress` during creation/update (https://github.com/hashicorp/go-azure-sdk/issues/565) "finishNewStorageSyncService": pollers.PollingStatusInProgress, diff --git a/vendor/modules.txt b/vendor/modules.txt index 6c387386f3c4..34ebe529e298 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1057,7 +1057,7 @@ github.com/hashicorp/go-azure-sdk/resource-manager/workloads/2023-04-01/saplands github.com/hashicorp/go-azure-sdk/resource-manager/workloads/2023-04-01/saprecommendations github.com/hashicorp/go-azure-sdk/resource-manager/workloads/2023-04-01/sapsupportedsku github.com/hashicorp/go-azure-sdk/resource-manager/workloads/2023-04-01/sapvirtualinstances -# github.com/hashicorp/go-azure-sdk/sdk v0.20240229.1102109 +# github.com/hashicorp/go-azure-sdk/sdk v0.20240314.1083835 ## explicit; go 1.21 github.com/hashicorp/go-azure-sdk/sdk/auth github.com/hashicorp/go-azure-sdk/sdk/auth/autorest