From b61561462245a115eb070c69042e28612606f459 Mon Sep 17 00:00:00 2001
From: sarna
Date: Sat, 26 Oct 2024 10:15:48 +0530
Subject: [PATCH] Dependencies: Use SDK version: v0.20241025.1143247
---
go.mod | 4 +--
go.sum | 8 ++---
.../go-azure-sdk/sdk/client/client.go | 16 +++++-----
.../sdk/client/resourcemanager/poller_lro.go | 20 +++++++++++--
.../poller_provisioning_state.go | 29 +++++++++++++++----
vendor/modules.txt | 4 +--
6 files changed, 57 insertions(+), 24 deletions(-)
diff --git a/go.mod b/go.mod
index c8f1d562ff35..ece4ad044f6c 100644
--- a/go.mod
+++ b/go.mod
@@ -17,8 +17,8 @@ require (
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
github.com/hashicorp/go-azure-helpers v0.70.1
- github.com/hashicorp/go-azure-sdk/resource-manager v0.20241021.1074254
- github.com/hashicorp/go-azure-sdk/sdk v0.20241021.1074254
+ github.com/hashicorp/go-azure-sdk/resource-manager v0.20241025.1143247
+ github.com/hashicorp/go-azure-sdk/sdk v0.20241025.1143247
github.com/hashicorp/go-hclog v1.6.3
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 42eaa051a6ad..c3ee2c22ec0a 100644
--- a/go.sum
+++ b/go.sum
@@ -93,10 +93,10 @@ github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-azure-helpers v0.70.1 h1:7hlnRrZobMZxpOzdlNEsayzAayj/KRG4wpDS1jgo4GM=
github.com/hashicorp/go-azure-helpers v0.70.1/go.mod h1:BmbF4JDYXK5sEmFeU5hcn8Br21uElcqLfdQxjatwQKw=
-github.com/hashicorp/go-azure-sdk/resource-manager v0.20241021.1074254 h1:HkfUWlUIfivTGMoTH3j4KsuKN3HGBv58zhuVDizTeUQ=
-github.com/hashicorp/go-azure-sdk/resource-manager v0.20241021.1074254/go.mod h1:JILPz8H5GILFudutdlFv4BxmwK+k53/91jnd7KtPxbc=
-github.com/hashicorp/go-azure-sdk/sdk v0.20241021.1074254 h1:u9xvP60m/rlIv5p4b+sewB98UOT9CGTHoOY7BkiX27Y=
-github.com/hashicorp/go-azure-sdk/sdk v0.20241021.1074254/go.mod h1:dMKF6bXrgGmy1d3pLzkmBpG2JIHgSAV2/OMSCEgyMwE=
+github.com/hashicorp/go-azure-sdk/resource-manager v0.20241025.1143247 h1:q+FN+mX0vq2k5YYuZF/s4Wvwvzr2l+6uzJumDP+uQX0=
+github.com/hashicorp/go-azure-sdk/resource-manager v0.20241025.1143247/go.mod h1:oZwKRGcvmYSosKkb2YSQH+HUx7LUaO9HXQyIobCYzso=
+github.com/hashicorp/go-azure-sdk/sdk v0.20241025.1143247 h1:NoYFgxtEsxHhE6TyJ6DRXqHLcxZ0cmrpGxNPio0lT84=
+github.com/hashicorp/go-azure-sdk/sdk v0.20241025.1143247/go.mod h1:dMKF6bXrgGmy1d3pLzkmBpG2JIHgSAV2/OMSCEgyMwE=
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/client.go b/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/client.go
index 557892028c32..52de494374ae 100644
--- a/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/client.go
+++ b/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/client.go
@@ -777,10 +777,10 @@ func extendedRetryPolicy(resp *http.Response, err error) (bool, error) {
// A regular expression to catch dial timeouts in the underlying TCP session
// connection
- tcpDialTimeoutRe := regexp.MustCompile(`dial tcp .*: i/o timeout`)
+ tcpDialTCPRe := regexp.MustCompile(`dial tcp`)
- // A regular expression to match complete packet loss - see comment below on packet-loss scenarios
- // completePacketLossRe := regexp.MustCompile(`EOF$`)
+ // A regular expression to match complete packet loss
+ completePacketLossRe := regexp.MustCompile(`EOF`)
if err != nil {
var v *url.Error
@@ -805,15 +805,13 @@ func extendedRetryPolicy(resp *http.Response, err error) (bool, error) {
return false, v
}
- if tcpDialTimeoutRe.MatchString(v.Error()) {
+ if tcpDialTCPRe.MatchString(v.Error()) {
return false, v
}
- // TODO - Need to investigate how to deal with total packet-loss situations that doesn't break LRO retries.
- // Such as Temporary Proxy outage, or recoverable disruption to network traffic (e.g. bgp events etc)
- // if completePacketLossRe.MatchString(v.Error()) {
- // return false, v
- // }
+ if completePacketLossRe.MatchString(v.Error()) {
+ return false, v
+ }
var certificateVerificationError *tls.CertificateVerificationError
if ok := errors.As(v.Err, &certificateVerificationError); ok {
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 0eade8da42ee..527257c3514b 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
@@ -7,6 +7,7 @@ import (
"bytes"
"context"
"encoding/json"
+ "errors"
"fmt"
"io"
"net/http"
@@ -27,6 +28,9 @@ type longRunningOperationPoller struct {
initialRetryDuration time.Duration
originalUrl *url.URL
pollingUrl *url.URL
+
+ droppedConnectionCount int
+ maxDroppedConnections int
}
func pollingUriForLongRunningOperation(resp *client.Response) string {
@@ -39,8 +43,9 @@ func pollingUriForLongRunningOperation(resp *client.Response) string {
func longRunningOperationPollerFromResponse(resp *client.Response, client *client.Client) (*longRunningOperationPoller, error) {
poller := longRunningOperationPoller{
- client: client,
- initialRetryDuration: 10 * time.Second,
+ client: client,
+ initialRetryDuration: 10 * time.Second,
+ maxDroppedConnections: 3,
}
pollingUrl := pollingUriForLongRunningOperation(resp)
@@ -107,9 +112,20 @@ func (p *longRunningOperationPoller) Poll(ctx context.Context) (result *pollers.
}
result.HttpResponse, err = req.Execute(ctx)
if err != nil {
+ var e *url.Error
+ if errors.As(err, &e) {
+ p.droppedConnectionCount++
+ if p.droppedConnectionCount < p.maxDroppedConnections {
+ result.Status = pollers.PollingStatusUnknown
+ return result, nil
+ }
+ }
+
return nil, err
}
+ p.droppedConnectionCount = 0
+
if result.HttpResponse != nil {
var respBody []byte
respBody, err = io.ReadAll(result.HttpResponse.Body)
diff --git a/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager/poller_provisioning_state.go b/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager/poller_provisioning_state.go
index f5c6f2e81d7a..cf80b2c4f0d9 100644
--- a/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager/poller_provisioning_state.go
+++ b/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager/poller_provisioning_state.go
@@ -5,6 +5,7 @@ package resourcemanager
import (
"context"
+ "errors"
"fmt"
"net/http"
"net/url"
@@ -27,6 +28,9 @@ type provisioningStatePoller struct {
initialRetryDuration time.Duration
originalUri string
resourcePath string
+
+ droppedConnectionCount int
+ maxDroppedConnections int
}
func provisioningStatePollerFromResponse(response *client.Response, lroIsSelfReference bool, client *Client, pollingInterval time.Duration) (*provisioningStatePoller, error) {
@@ -58,11 +62,12 @@ func provisioningStatePollerFromResponse(response *client.Response, lroIsSelfRef
}
return &provisioningStatePoller{
- apiVersion: apiVersion,
- client: client,
- initialRetryDuration: pollingInterval,
- originalUri: originalUri,
- resourcePath: resourcePath,
+ apiVersion: apiVersion,
+ client: client,
+ initialRetryDuration: pollingInterval,
+ originalUri: originalUri,
+ resourcePath: resourcePath,
+ maxDroppedConnections: 3,
}, nil
}
@@ -84,8 +89,22 @@ func (p *provisioningStatePoller) Poll(ctx context.Context) (*pollers.PollResult
}
resp, err := p.client.Execute(ctx, req)
if err != nil {
+ var e *url.Error
+ if errors.As(err, &e) {
+ p.droppedConnectionCount++
+ if p.droppedConnectionCount < p.maxDroppedConnections {
+ return &pollers.PollResult{
+ PollInterval: p.initialRetryDuration,
+ Status: pollers.PollingStatusUnknown,
+ }, nil
+ }
+ }
+
return nil, fmt.Errorf("executing request: %+v", err)
}
+
+ p.droppedConnectionCount = 0
+
if resp == nil {
return nil, pollers.PollingDroppedConnectionError{}
}
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 93b602934b9a..9fbe19904d6f 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -148,7 +148,7 @@ github.com/hashicorp/go-azure-helpers/resourcemanager/tags
github.com/hashicorp/go-azure-helpers/resourcemanager/zones
github.com/hashicorp/go-azure-helpers/sender
github.com/hashicorp/go-azure-helpers/storage
-# github.com/hashicorp/go-azure-sdk/resource-manager v0.20241021.1074254
+# github.com/hashicorp/go-azure-sdk/resource-manager v0.20241025.1143247
## explicit; go 1.21
github.com/hashicorp/go-azure-sdk/resource-manager/aad/2021-05-01/domainservices
github.com/hashicorp/go-azure-sdk/resource-manager/aadb2c/2021-04-01-preview
@@ -1117,7 +1117,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.20241021.1074254
+# github.com/hashicorp/go-azure-sdk/sdk v0.20241025.1143247
## explicit; go 1.21
github.com/hashicorp/go-azure-sdk/sdk/auth
github.com/hashicorp/go-azure-sdk/sdk/auth/autorest