From d0ef419a1b7781900a43b97c4cc0b2c825cdf2f1 Mon Sep 17 00:00:00 2001 From: Tom Bamford Date: Fri, 10 Sep 2021 13:43:01 +0100 Subject: [PATCH] Bump Hamilton to v0.28.2 for critical bug fix in retryable response handling --- go.mod | 2 +- go.sum | 4 ++-- vendor/github.com/manicminer/hamilton/msgraph/client.go | 7 +++++++ vendor/modules.txt | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 2c968b7153..15033f8b2a 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.0 github.com/hashicorp/yamux v0.0.0-20210316155119-a95892c5f864 // indirect github.com/klauspost/compress v1.12.2 // indirect - github.com/manicminer/hamilton v0.28.1 + github.com/manicminer/hamilton v0.28.2 github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/mitchellh/mapstructure v1.4.1 // indirect diff --git a/go.sum b/go.sum index 6b1eae5065..b760b34f0a 100644 --- a/go.sum +++ b/go.sum @@ -285,8 +285,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/manicminer/hamilton v0.28.1 h1:i+ZDEZOqa17DFhFji9vCA44Lk3FkOFV/jcfNvO1vx34= -github.com/manicminer/hamilton v0.28.1/go.mod h1:QryxpD/4+cdKuXNi0UjLDvgxYdP0LLmYz7dYU7DAX4U= +github.com/manicminer/hamilton v0.28.2 h1:W+ZRftPTOgWAa9zr3bUW1CzU1yOMFz1ZumHcA5kXqes= +github.com/manicminer/hamilton v0.28.2/go.mod h1:QryxpD/4+cdKuXNi0UjLDvgxYdP0LLmYz7dYU7DAX4U= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= diff --git a/vendor/github.com/manicminer/hamilton/msgraph/client.go b/vendor/github.com/manicminer/hamilton/msgraph/client.go index 1d56f08dbc..6c032205c0 100644 --- a/vendor/github.com/manicminer/hamilton/msgraph/client.go +++ b/vendor/github.com/manicminer/hamilton/msgraph/client.go @@ -55,6 +55,12 @@ type Uri struct { HasTenantId bool } +// RetryableErrorHandler ensures that the response is returned after exhausting retries for a request +// We can't return an error here, or net/http will not return the response +func RetryableErrorHandler(resp *http.Response, err error, numTries int) (*http.Response, error) { + return resp, nil +} + // Client is a base client to be used by clients for specific entities. // It can send GET, POST, PUT, PATCH and DELETE requests to Microsoft Graph and is API version and tenant aware. type Client struct { @@ -91,6 +97,7 @@ type Client struct { // NewClient returns a new Client configured with the specified API version and tenant ID. func NewClient(apiVersion ApiVersion, tenantId string) Client { r := retryablehttp.NewClient() + r.ErrorHandler = RetryableErrorHandler r.Logger = nil return Client{ diff --git a/vendor/modules.txt b/vendor/modules.txt index d5330d0e45..65562dba14 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -192,7 +192,7 @@ github.com/klauspost/compress/fse github.com/klauspost/compress/huff0 github.com/klauspost/compress/zstd github.com/klauspost/compress/zstd/internal/xxhash -# github.com/manicminer/hamilton v0.28.1 +# github.com/manicminer/hamilton v0.28.2 ## explicit github.com/manicminer/hamilton/auth github.com/manicminer/hamilton/environments