diff --git a/go.mod b/go.mod index 9654911d3363..fd2c935d8e5c 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.67.0 github.com/hashicorp/go-azure-sdk/resource-manager v0.20240417.1084633 - github.com/hashicorp/go-azure-sdk/sdk v0.20240417.1084633 + github.com/hashicorp/go-azure-sdk/sdk v0.20240422.1112441 github.com/hashicorp/go-hclog v1.5.0 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-uuid v1.0.3 @@ -29,7 +29,7 @@ require ( github.com/mitchellh/mapstructure v1.5.0 github.com/rickb777/date v1.12.5-0.20200422084442-6300e543c4d9 github.com/sergi/go-diff v1.2.0 - github.com/tombuildsstuff/giovanni v0.26.1 + github.com/tombuildsstuff/giovanni v0.27.0 github.com/tombuildsstuff/kermit v0.20240122.1123108 golang.org/x/crypto v0.21.0 golang.org/x/tools v0.13.0 diff --git a/go.sum b/go.sum index 09aae75fe576..270f1e65b39a 100644 --- a/go.sum +++ b/go.sum @@ -97,8 +97,8 @@ github.com/hashicorp/go-azure-helpers v0.67.0 h1:0RY6mY3W3Ym2I+jExLtyLx96fh6p5n9 github.com/hashicorp/go-azure-helpers v0.67.0/go.mod h1:S4Bu66vyJvHA0trqHQB0YVGsISuF7HMH9tyEsMVlx8A= github.com/hashicorp/go-azure-sdk/resource-manager v0.20240417.1084633 h1:gnSitHO7XjVdqOCLeifIwx4m6oRj/hbl4BKdCcvRHSk= github.com/hashicorp/go-azure-sdk/resource-manager v0.20240417.1084633/go.mod h1:ddn6gE/zxtwsQK6b/40FF3zRpC8QbM/rbufJc36U01k= -github.com/hashicorp/go-azure-sdk/sdk v0.20240417.1084633 h1:PP+147mt/G4sizC3hQPqeTWF2nIOm9Qi2JDkWYR8uNs= -github.com/hashicorp/go-azure-sdk/sdk v0.20240417.1084633/go.mod h1:POOjeoqNp+mvlLBuibJTziUAkBZ7FxXGeGestwemL/w= +github.com/hashicorp/go-azure-sdk/sdk v0.20240422.1112441 h1:BGDyjzyjD+NhcL9cd+WhMIgAzY+/wKB30nD4h34sEPg= +github.com/hashicorp/go-azure-sdk/sdk v0.20240422.1112441/go.mod h1:Ts5vRL3KPw8iLit+4WSi1hOWlRCx++wJrCkMGj69xBY= 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= @@ -225,8 +225,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/tombuildsstuff/giovanni v0.26.1 h1:RZgnpyIHtgw0GXYpw3xttNk35obJNoI1hztCZsh/Djo= -github.com/tombuildsstuff/giovanni v0.26.1/go.mod h1:s7xbU2lN5Iz9MBglmDDv9p2QPbn6x3UkJBtpCfUerLs= +github.com/tombuildsstuff/giovanni v0.27.0 h1:3CDNjauK78FIhvvCp0SAHlvNcPTcofR6zQXvxwhk4zY= +github.com/tombuildsstuff/giovanni v0.27.0/go.mod h1:SviBdlwdVn2HyArdRABBqMUODBJ2adQHi+RFEVaO05I= github.com/tombuildsstuff/kermit v0.20240122.1123108 h1:icQaxsv/ANv/KC4Sr0V1trrWA/XIL+3QAVBDpiSTgj8= github.com/tombuildsstuff/kermit v0.20240122.1123108/go.mod h1:T3YBVFhRV4qA7SbnRaNE6eapIMpKDA9rG/V7Ocsjlno= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= diff --git a/internal/services/storage/storage_account_resource_test.go b/internal/services/storage/storage_account_resource_test.go index 80c039c6b58c..96f9990fe7bb 100644 --- a/internal/services/storage/storage_account_resource_test.go +++ b/internal/services/storage/storage_account_resource_test.go @@ -1113,13 +1113,13 @@ func TestAccAzureRMStorageAccount_shareSoftDelete(t *testing.T) { }) } -func TestAccStorageAccount_allowSharedKeyAccess(t *testing.T) { +func TestAccStorageAccount_sharedKeyAccess(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_storage_account", "test") r := StorageAccountResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { - Config: r.allowSharedKeyAccess(data), + Config: r.sharedKeyAccessDisabled(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), check.That(data.ResourceName).Key("account_tier").HasValue("Standard"), @@ -1129,8 +1129,9 @@ func TestAccStorageAccount_allowSharedKeyAccess(t *testing.T) { check.That(data.ResourceName).Key("shared_access_key_enabled").HasValue("false"), ), }, + data.ImportStep(), { - Config: r.allowSharedKeyAccessUpdated(data), + Config: r.sharedKeyAccessEnabled(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), check.That(data.ResourceName).Key("account_tier").HasValue("Standard"), @@ -1140,6 +1141,31 @@ func TestAccStorageAccount_allowSharedKeyAccess(t *testing.T) { check.That(data.ResourceName).Key("shared_access_key_enabled").HasValue("true"), ), }, + data.ImportStep(), + { + Config: r.sharedKeyAccessDisabled(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("account_tier").HasValue("Standard"), + check.That(data.ResourceName).Key("account_replication_type").HasValue("LRS"), + check.That(data.ResourceName).Key("tags.%").HasValue("1"), + check.That(data.ResourceName).Key("tags.environment").HasValue("production"), + check.That(data.ResourceName).Key("shared_access_key_enabled").HasValue("false"), + ), + }, + data.ImportStep(), + }) +} + +func TestAccStorageAccount_sharedKeyAccessUnsupported(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_storage_account", "test") + r := StorageAccountResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.sharedKeyAccessDisabledWithAzureADAuthDisabled(data), + ExpectError: regexp.MustCompile("Key based authentication is not permitted on this storage account"), + }, }) } @@ -3785,7 +3811,7 @@ resource "azurerm_storage_account" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomString) } -func (r StorageAccountResource) allowSharedKeyAccess(data acceptance.TestData) string { +func (r StorageAccountResource) sharedKeyAccessDisabled(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { features {} @@ -3813,7 +3839,7 @@ resource "azurerm_storage_account" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomString) } -func (r StorageAccountResource) allowSharedKeyAccessUpdated(data acceptance.TestData) string { +func (r StorageAccountResource) sharedKeyAccessEnabled(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { features {} @@ -3841,6 +3867,30 @@ resource "azurerm_storage_account" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomString) } +func (r StorageAccountResource) sharedKeyAccessDisabledWithAzureADAuthDisabled(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} + storage_use_azuread = false +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-storage-%d" + location = "%s" +} + +resource "azurerm_storage_account" "test" { + name = "unlikely23exst2acct%s" + resource_group_name = azurerm_resource_group.test.name + + location = azurerm_resource_group.test.location + account_tier = "Standard" + account_replication_type = "LRS" + shared_access_key_enabled = false +} +`, data.RandomInteger, data.Locations.Primary, data.RandomString) +} + func (r StorageAccountResource) defaultToOAuthAuthentication(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { 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 29102933c372..1355029b7b03 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 @@ -71,7 +71,11 @@ func RequestRetryAll(retryFuncs ...RequestRetryFunc) func(resp *http.Response, o // RetryableErrorHandler simply returns the resp and err, this is needed to make the Do() method // of retryablehttp client return early with the response body not drained. func RetryableErrorHandler(resp *http.Response, err error, _ int) (*http.Response, error) { - return resp, err + if resp == nil { + return nil, err + } + + return resp, nil } // Request embeds *http.Request and adds useful metadata @@ -83,6 +87,8 @@ type Request struct { Client BaseClient Pager odata.CustomPager + CustomErrorParser ResponseErrorParser + // Embed *http.Request so that we can send this to an *http.Client *http.Request } @@ -532,22 +538,33 @@ func (c *Client) Execute(ctx context.Context, req *Request) (*Response, error) { // Determine suitable error text var errText string - switch { - case resp.OData != nil && resp.OData.Error != nil && resp.OData.Error.String() != "": - errText = fmt.Sprintf("error: %s", resp.OData.Error) - - default: - defer resp.Body.Close() - respBody, err := io.ReadAll(resp.Body) - if err != nil { - return resp, fmt.Errorf("unexpected status %s, could not read response body", status) - } - if len(respBody) == 0 { - return resp, fmt.Errorf("unexpected status %s received with no body", status) + // Use a custom response error handler if provided + if req.CustomErrorParser != nil { + if err = req.CustomErrorParser.FromResponse(resp.Response); err != nil { + errText = err.Error() } + } + + // Fall back to parsing error text from OData + if errText == "" { + switch { + case resp.OData != nil && resp.OData.Error != nil && resp.OData.Error.String() != "": + errText = fmt.Sprintf("error: %s", resp.OData.Error) + + default: + defer resp.Body.Close() + + respBody, err := io.ReadAll(resp.Body) + if err != nil { + return resp, fmt.Errorf("unexpected status %s, could not read response body", status) + } + if len(respBody) == 0 { + return resp, fmt.Errorf("unexpected status %s received with no body", status) + } - errText = fmt.Sprintf("response: %s", respBody) + errText = fmt.Sprintf("response: %s", respBody) + } } return resp, fmt.Errorf("unexpected status %s with %s", status, errText) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/dataplane/storage/client.go b/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/dataplane/storage/client.go index 27dedf17c000..88b480e220c5 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/dataplane/storage/client.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/dataplane/storage/client.go @@ -66,6 +66,8 @@ func (c *Client) NewRequest(ctx context.Context, input client.RequestOptions) (* } req.URL.RawQuery = query.Encode() + + req.CustomErrorParser = &ErrorParser{} req.RetryFunc = client.RequestRetryAny(append(storageDefaultRetryFunctions, input.RetryFunc)...) req.ValidStatusCodes = input.ExpectedStatusCodes diff --git a/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/dataplane/storage/errors.go b/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/dataplane/storage/errors.go new file mode 100644 index 000000000000..03269b3c795e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/dataplane/storage/errors.go @@ -0,0 +1,48 @@ +package storage + +import ( + "bytes" + "encoding/xml" + "fmt" + "io" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" +) + +var _ error = &storageError{} + +type storageError struct { + XMLName xml.Name `xml:"Error"` + Code string `xml:"Code"` + Message string `xml:"Message"` +} + +func (e *storageError) Error() string { + out := e.Message + if e.Code != "" { + out = fmt.Sprintf("%s: %s", e.Code, out) + } + return out +} + +var _ client.ResponseErrorParser = &ErrorParser{} + +// ErrorParser is a custom error parse for Azure Storage errors +type ErrorParser struct{} + +func (e *ErrorParser) FromResponse(resp *http.Response) error { + respBody, err := io.ReadAll(resp.Body) + if err != nil { + return fmt.Errorf("could not parse response body") + } + resp.Body.Close() + respBody = bytes.TrimPrefix(respBody, []byte("\xef\xbb\xbf")) + + res := storageError{} + if err = xml.Unmarshal(respBody, &res); err != nil { + return err + } + resp.Body = io.NopCloser(bytes.NewBuffer(respBody)) + return &res +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/interface.go b/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/interface.go index 5886a19ff574..782942cc5ff9 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/interface.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/sdk/client/interface.go @@ -54,3 +54,8 @@ type ResponseMiddleware func(*http.Request, *http.Response) (*http.Response, err // ValidStatusFunc is a function that tests whether an HTTP response is considered valid for the particular request. type ValidStatusFunc func(*http.Response, *odata.OData) bool + +// ResponseErrorParser is an optional custom parser that can parse an API error response to provide a friendly error +type ResponseErrorParser interface { + FromResponse(*http.Response) error +} diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/accounts/get_service_properties.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/accounts/get_service_properties.go index 668b1276d4cd..5c008985a833 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/accounts/get_service_properties.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/accounts/get_service_properties.go @@ -39,10 +39,12 @@ func (c Client) GetServiceProperties(ctx context.Context, accountName string) (r if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - err = resp.Unmarshal(&result) - if err != nil { - err = fmt.Errorf("unmarshalling response: %+v", err) - return + if err == nil { + err = resp.Unmarshal(&result) + if err != nil { + err = fmt.Errorf("unmarshalling response: %+v", err) + return + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/append_block.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/append_block.go index 26374e85ead9..d5a424d132e8 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/append_block.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/append_block.go @@ -105,19 +105,21 @@ func (c Client) AppendBlock(ctx context.Context, containerName, blobName string, if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.BlobAppendOffset = resp.Header.Get("x-ms-blob-append-offset") - result.ContentMD5 = resp.Header.Get("Content-MD5") - result.ETag = resp.Header.Get("ETag") - result.LastModified = resp.Header.Get("Last-Modified") - - if v := resp.Header.Get("x-ms-blob-committed-block-count"); v != "" { - i, innerErr := strconv.Atoi(v) - if innerErr != nil { - err = fmt.Errorf("parsing `x-ms-blob-committed-block-count` header value %q: %+v", v, innerErr) - return + if err == nil { + if resp.Header != nil { + result.BlobAppendOffset = resp.Header.Get("x-ms-blob-append-offset") + result.ContentMD5 = resp.Header.Get("Content-MD5") + result.ETag = resp.Header.Get("ETag") + result.LastModified = resp.Header.Get("Last-Modified") + + if v := resp.Header.Get("x-ms-blob-committed-block-count"); v != "" { + i, innerErr := strconv.Atoi(v) + if innerErr != nil { + err = fmt.Errorf("parsing `x-ms-blob-committed-block-count` header value %q: %+v", v, innerErr) + return + } + result.BlobCommittedBlockCount = int64(i) } - result.BlobCommittedBlockCount = int64(i) } } } diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/copy.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/copy.go index 50360cf6395c..2565c6470bc0 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/copy.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/copy.go @@ -155,9 +155,11 @@ func (c Client) Copy(ctx context.Context, containerName, blobName string, input if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.CopyID = resp.Header.Get("x-ms-copy-id") - result.CopyStatus = resp.Header.Get("x-ms-copy-status") + if err == nil { + if resp.Header != nil { + result.CopyID = resp.Header.Get("x-ms-copy-id") + result.CopyStatus = resp.Header.Get("x-ms-copy-status") + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/get.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/get.go index 0e49f43f87c8..4c8a4b50d382 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/get.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/get.go @@ -68,14 +68,16 @@ func (c Client) Get(ctx context.Context, containerName, blobName string, input G if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Body != nil { - defer resp.Body.Close() - respBody, err := io.ReadAll(resp.Body) - if err != nil { - return result, fmt.Errorf("could not parse response body") + if err == nil { + if resp.Body != nil { + defer resp.Body.Close() + respBody, err := io.ReadAll(resp.Body) + if err != nil { + return result, fmt.Errorf("could not parse response body") + } + + result.Contents = &respBody } - - result.Contents = &respBody } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/get_block_list.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/get_block_list.go index 45a30a693afa..07277d167e5c 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/get_block_list.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/get_block_list.go @@ -71,26 +71,28 @@ func (c Client) GetBlockList(ctx context.Context, containerName, blobName string if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.ContentType = resp.Header.Get("Content-Type") - result.ETag = resp.Header.Get("ETag") - - if v := resp.Header.Get("x-ms-blob-content-length"); v != "" { - i, innerErr := strconv.Atoi(v) - if innerErr != nil { - err = fmt.Errorf("parsing `x-ms-blob-content-length` header value %q: %s", v, innerErr) - return + if err == nil { + if resp.Header != nil { + result.ContentType = resp.Header.Get("Content-Type") + result.ETag = resp.Header.Get("ETag") + + if v := resp.Header.Get("x-ms-blob-content-length"); v != "" { + i, innerErr := strconv.Atoi(v) + if innerErr != nil { + err = fmt.Errorf("parsing `x-ms-blob-content-length` header value %q: %s", v, innerErr) + return + } + + i64 := int64(i) + result.BlobContentLength = &i64 } - - i64 := int64(i) - result.BlobContentLength = &i64 } - } - err = resp.Unmarshal(&result) - if err != nil { - err = fmt.Errorf("unmarshalling response: %+v", err) - return + err = resp.Unmarshal(&result) + if err != nil { + err = fmt.Errorf("unmarshalling response: %+v", err) + return + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/get_page_ranges.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/get_page_ranges.go index 5341365e2297..cb91a0a8cadf 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/get_page_ranges.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/get_page_ranges.go @@ -81,26 +81,28 @@ func (c Client) GetPageRanges(ctx context.Context, containerName, blobName strin if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.ContentType = resp.Header.Get("Content-Type") - result.ETag = resp.Header.Get("ETag") - - if v := resp.Header.Get("x-ms-blob-content-length"); v != "" { - i, innerErr := strconv.Atoi(v) - if innerErr != nil { - err = fmt.Errorf("parsing `x-ms-blob-content-length` header value %q: %+v", v, innerErr) - return + if err == nil { + if resp.Header != nil { + result.ContentType = resp.Header.Get("Content-Type") + result.ETag = resp.Header.Get("ETag") + + if v := resp.Header.Get("x-ms-blob-content-length"); v != "" { + i, innerErr := strconv.Atoi(v) + if innerErr != nil { + err = fmt.Errorf("parsing `x-ms-blob-content-length` header value %q: %+v", v, innerErr) + return + } + + i64 := int64(i) + result.ContentLength = &i64 } - - i64 := int64(i) - result.ContentLength = &i64 } - } - err = resp.Unmarshal(&result) - if err != nil { - err = fmt.Errorf("unmarshalling response: %+v", err) - return + err = resp.Unmarshal(&result) + if err != nil { + err = fmt.Errorf("unmarshalling response: %+v", err) + return + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/lease_acquire.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/lease_acquire.go index bf81cb37f93f..1c807c3b0008 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/lease_acquire.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/lease_acquire.go @@ -83,8 +83,10 @@ func (c Client) AcquireLease(ctx context.Context, containerName, blobName string if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Response != nil && resp.Header != nil { - result.LeaseID = resp.Header.Get("x-ms-lease-id") + if err == nil { + if resp.Response != nil && resp.Header != nil { + result.LeaseID = resp.Header.Get("x-ms-lease-id") + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/lease_change.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/lease_change.go index 46ee08022565..d7f236d7f55d 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/lease_change.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/lease_change.go @@ -70,8 +70,10 @@ func (c Client) ChangeLease(ctx context.Context, containerName, blobName string, if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Response != nil && resp.Header != nil { - result.LeaseID = resp.Header.Get("x-ms-lease-id") + if err == nil { + if resp.Response != nil && resp.Header != nil { + result.LeaseID = resp.Header.Get("x-ms-lease-id") + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/properties_get.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/properties_get.go index 6ae254d71f36..ba143433bd7a 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/properties_get.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/properties_get.go @@ -200,68 +200,70 @@ func (c Client) GetProperties(ctx context.Context, containerName, blobName strin if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.AccessTier = AccessTier(resp.Header.Get("x-ms-access-tier")) - result.AccessTierChangeTime = resp.Header.Get("x-ms-access-tier-change-time") - result.ArchiveStatus = ArchiveStatus(resp.Header.Get("x-ms-archive-status")) - result.BlobCommittedBlockCount = resp.Header.Get("x-ms-blob-committed-block-count") - result.BlobSequenceNumber = resp.Header.Get("x-ms-blob-sequence-number") - result.BlobType = BlobType(resp.Header.Get("x-ms-blob-type")) - result.CacheControl = resp.Header.Get("Cache-Control") - result.ContentDisposition = resp.Header.Get("Content-Disposition") - result.ContentEncoding = resp.Header.Get("Content-Encoding") - result.ContentLanguage = resp.Header.Get("Content-Language") - result.ContentMD5 = resp.Header.Get("Content-MD5") - result.ContentType = resp.Header.Get("Content-Type") - result.CopyCompletionTime = resp.Header.Get("x-ms-copy-completion-time") - result.CopyDestinationSnapshot = resp.Header.Get("x-ms-copy-destination-snapshot") - result.CopyID = resp.Header.Get("x-ms-copy-id") - result.CopyProgress = resp.Header.Get("x-ms-copy-progress") - result.CopySource = resp.Header.Get("x-ms-copy-source") - result.CopyStatus = CopyStatus(resp.Header.Get("x-ms-copy-status")) - result.CopyStatusDescription = resp.Header.Get("x-ms-copy-status-description") - result.CreationTime = resp.Header.Get("x-ms-creation-time") - result.ETag = resp.Header.Get("Etag") - result.LastModified = resp.Header.Get("Last-Modified") - result.LeaseDuration = LeaseDuration(resp.Header.Get("x-ms-lease-duration")) - result.LeaseState = LeaseState(resp.Header.Get("x-ms-lease-state")) - result.LeaseStatus = LeaseStatus(resp.Header.Get("x-ms-lease-status")) - result.EncryptionScope = resp.Header.Get("x-ms-encryption-scope") - result.MetaData = metadata.ParseFromHeaders(resp.Header) - - if v := resp.Header.Get("x-ms-access-tier-inferred"); v != "" { - b, innerErr := strconv.ParseBool(v) - if innerErr != nil { - err = fmt.Errorf("parsing `x-ms-access-tier-inferred` header value %q: %s", v, innerErr) - return + if err == nil { + if resp.Header != nil { + result.AccessTier = AccessTier(resp.Header.Get("x-ms-access-tier")) + result.AccessTierChangeTime = resp.Header.Get("x-ms-access-tier-change-time") + result.ArchiveStatus = ArchiveStatus(resp.Header.Get("x-ms-archive-status")) + result.BlobCommittedBlockCount = resp.Header.Get("x-ms-blob-committed-block-count") + result.BlobSequenceNumber = resp.Header.Get("x-ms-blob-sequence-number") + result.BlobType = BlobType(resp.Header.Get("x-ms-blob-type")) + result.CacheControl = resp.Header.Get("Cache-Control") + result.ContentDisposition = resp.Header.Get("Content-Disposition") + result.ContentEncoding = resp.Header.Get("Content-Encoding") + result.ContentLanguage = resp.Header.Get("Content-Language") + result.ContentMD5 = resp.Header.Get("Content-MD5") + result.ContentType = resp.Header.Get("Content-Type") + result.CopyCompletionTime = resp.Header.Get("x-ms-copy-completion-time") + result.CopyDestinationSnapshot = resp.Header.Get("x-ms-copy-destination-snapshot") + result.CopyID = resp.Header.Get("x-ms-copy-id") + result.CopyProgress = resp.Header.Get("x-ms-copy-progress") + result.CopySource = resp.Header.Get("x-ms-copy-source") + result.CopyStatus = CopyStatus(resp.Header.Get("x-ms-copy-status")) + result.CopyStatusDescription = resp.Header.Get("x-ms-copy-status-description") + result.CreationTime = resp.Header.Get("x-ms-creation-time") + result.ETag = resp.Header.Get("Etag") + result.LastModified = resp.Header.Get("Last-Modified") + result.LeaseDuration = LeaseDuration(resp.Header.Get("x-ms-lease-duration")) + result.LeaseState = LeaseState(resp.Header.Get("x-ms-lease-state")) + result.LeaseStatus = LeaseStatus(resp.Header.Get("x-ms-lease-status")) + result.EncryptionScope = resp.Header.Get("x-ms-encryption-scope") + result.MetaData = metadata.ParseFromHeaders(resp.Header) + + if v := resp.Header.Get("x-ms-access-tier-inferred"); v != "" { + b, innerErr := strconv.ParseBool(v) + if innerErr != nil { + err = fmt.Errorf("parsing `x-ms-access-tier-inferred` header value %q: %s", v, innerErr) + return + } + result.AccessTierInferred = b } - result.AccessTierInferred = b - } - if v := resp.Header.Get("Content-Length"); v != "" { - i, innerErr := strconv.Atoi(v) - if innerErr != nil { - err = fmt.Errorf("parsing `Content-Length` header value %q: %s", v, innerErr) + if v := resp.Header.Get("Content-Length"); v != "" { + i, innerErr := strconv.Atoi(v) + if innerErr != nil { + err = fmt.Errorf("parsing `Content-Length` header value %q: %s", v, innerErr) + } + result.ContentLength = int64(i) } - result.ContentLength = int64(i) - } - if v := resp.Header.Get("x-ms-incremental-copy"); v != "" { - b, innerErr := strconv.ParseBool(v) - if innerErr != nil { - err = fmt.Errorf("parsing `x-ms-incremental-copy` header value %q: %s", v, innerErr) - return + if v := resp.Header.Get("x-ms-incremental-copy"); v != "" { + b, innerErr := strconv.ParseBool(v) + if innerErr != nil { + err = fmt.Errorf("parsing `x-ms-incremental-copy` header value %q: %s", v, innerErr) + return + } + result.IncrementalCopy = b } - result.IncrementalCopy = b - } - if v := resp.Header.Get("x-ms-server-encrypted"); v != "" { - b, innerErr := strconv.ParseBool(v) - if innerErr != nil { - err = fmt.Errorf("parsing `x-ms-server-encrypted` header value %q: %s", v, innerErr) - return + if v := resp.Header.Get("x-ms-server-encrypted"); v != "" { + b, innerErr := strconv.ParseBool(v) + if innerErr != nil { + err = fmt.Errorf("parsing `x-ms-server-encrypted` header value %q: %s", v, innerErr) + return + } + result.ServerEncrypted = b } - result.ServerEncrypted = b } } } diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/put_block_list.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/put_block_list.go index cf04af035ac0..8ac5a83fbc44 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/put_block_list.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/put_block_list.go @@ -89,10 +89,12 @@ func (c Client) PutBlockList(ctx context.Context, containerName, blobName string if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.ContentMD5 = resp.Header.Get("Content-MD5") - result.ETag = resp.Header.Get("ETag") - result.LastModified = resp.Header.Get("Last-Modified") + if err == nil { + if resp.Header != nil { + result.ContentMD5 = resp.Header.Get("Content-MD5") + result.ETag = resp.Header.Get("ETag") + result.LastModified = resp.Header.Get("Last-Modified") + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/put_block_url.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/put_block_url.go index 2b683d7e8305..a9b531077f2a 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/put_block_url.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/put_block_url.go @@ -74,8 +74,10 @@ func (c Client) PutBlockFromURL(ctx context.Context, containerName, blobName str if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.ContentMD5 = resp.Header.Get("Content-MD5") + if err == nil { + if resp.Header != nil { + result.ContentMD5 = resp.Header.Get("Content-MD5") + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/put_page_update.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/put_page_update.go index 3294d462e97f..acfc859528fd 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/put_page_update.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/put_page_update.go @@ -97,10 +97,12 @@ func (c Client) PutPageUpdate(ctx context.Context, containerName, blobName strin if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.BlobSequenceNumber = resp.Header.Get("x-ms-blob-sequence-number") - result.ContentMD5 = resp.Header.Get("Content-MD5") - result.LastModified = resp.Header.Get("Last-Modified") + if err == nil { + if resp.Header != nil { + result.BlobSequenceNumber = resp.Header.Get("x-ms-blob-sequence-number") + result.ContentMD5 = resp.Header.Get("Content-MD5") + result.LastModified = resp.Header.Get("Last-Modified") + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/snapshot.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/snapshot.go index 18ddcd28aea7..d925dc1da52f 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/snapshot.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/snapshot.go @@ -99,9 +99,11 @@ func (c Client) Snapshot(ctx context.Context, containerName, blobName string, in if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.ETag = resp.Header.Get("ETag") - result.SnapshotDateTime = resp.Header.Get("x-ms-snapshot") + if err == nil { + if resp.Header != nil { + result.ETag = resp.Header.Get("ETag") + result.SnapshotDateTime = resp.Header.Get("x-ms-snapshot") + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/snapshot_get_properties.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/snapshot_get_properties.go index 59f3607f1ca0..50a50a4ce4a5 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/snapshot_get_properties.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs/snapshot_get_properties.go @@ -66,71 +66,73 @@ func (c Client) GetSnapshotProperties(ctx context.Context, containerName, blobNa if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.AccessTier = AccessTier(resp.Header.Get("x-ms-access-tier")) - result.AccessTierChangeTime = resp.Header.Get("x-ms-access-tier-change-time") - result.ArchiveStatus = ArchiveStatus(resp.Header.Get("x-ms-archive-status")) - result.BlobCommittedBlockCount = resp.Header.Get("x-ms-blob-committed-block-count") - result.BlobSequenceNumber = resp.Header.Get("x-ms-blob-sequence-number") - result.BlobType = BlobType(resp.Header.Get("x-ms-blob-type")) - result.CacheControl = resp.Header.Get("Cache-Control") - result.ContentDisposition = resp.Header.Get("Content-Disposition") - result.ContentEncoding = resp.Header.Get("Content-Encoding") - result.ContentLanguage = resp.Header.Get("Content-Language") - result.ContentMD5 = resp.Header.Get("Content-MD5") - result.ContentType = resp.Header.Get("Content-Type") - result.CopyCompletionTime = resp.Header.Get("x-ms-copy-completion-time") - result.CopyDestinationSnapshot = resp.Header.Get("x-ms-copy-destination-snapshot") - result.CopyID = resp.Header.Get("x-ms-copy-id") - result.CopyProgress = resp.Header.Get("x-ms-copy-progress") - result.CopySource = resp.Header.Get("x-ms-copy-source") - result.CopyStatus = CopyStatus(resp.Header.Get("x-ms-copy-status")) - result.CopyStatusDescription = resp.Header.Get("x-ms-copy-status-description") - result.CreationTime = resp.Header.Get("x-ms-creation-time") - result.ETag = resp.Header.Get("Etag") - result.LastModified = resp.Header.Get("Last-Modified") - result.LeaseDuration = LeaseDuration(resp.Header.Get("x-ms-lease-duration")) - result.LeaseState = LeaseState(resp.Header.Get("x-ms-lease-state")) - result.LeaseStatus = LeaseStatus(resp.Header.Get("x-ms-lease-status")) - result.MetaData = metadata.ParseFromHeaders(resp.Header) - - if v := resp.Header.Get("Content-Length"); v != "" { - i, innerErr := strconv.Atoi(v) - if innerErr != nil { - err = fmt.Errorf("parsing `Content-Length` header value %q: %+v", v, innerErr) + if err == nil { + if resp.Header != nil { + result.AccessTier = AccessTier(resp.Header.Get("x-ms-access-tier")) + result.AccessTierChangeTime = resp.Header.Get("x-ms-access-tier-change-time") + result.ArchiveStatus = ArchiveStatus(resp.Header.Get("x-ms-archive-status")) + result.BlobCommittedBlockCount = resp.Header.Get("x-ms-blob-committed-block-count") + result.BlobSequenceNumber = resp.Header.Get("x-ms-blob-sequence-number") + result.BlobType = BlobType(resp.Header.Get("x-ms-blob-type")) + result.CacheControl = resp.Header.Get("Cache-Control") + result.ContentDisposition = resp.Header.Get("Content-Disposition") + result.ContentEncoding = resp.Header.Get("Content-Encoding") + result.ContentLanguage = resp.Header.Get("Content-Language") + result.ContentMD5 = resp.Header.Get("Content-MD5") + result.ContentType = resp.Header.Get("Content-Type") + result.CopyCompletionTime = resp.Header.Get("x-ms-copy-completion-time") + result.CopyDestinationSnapshot = resp.Header.Get("x-ms-copy-destination-snapshot") + result.CopyID = resp.Header.Get("x-ms-copy-id") + result.CopyProgress = resp.Header.Get("x-ms-copy-progress") + result.CopySource = resp.Header.Get("x-ms-copy-source") + result.CopyStatus = CopyStatus(resp.Header.Get("x-ms-copy-status")) + result.CopyStatusDescription = resp.Header.Get("x-ms-copy-status-description") + result.CreationTime = resp.Header.Get("x-ms-creation-time") + result.ETag = resp.Header.Get("Etag") + result.LastModified = resp.Header.Get("Last-Modified") + result.LeaseDuration = LeaseDuration(resp.Header.Get("x-ms-lease-duration")) + result.LeaseState = LeaseState(resp.Header.Get("x-ms-lease-state")) + result.LeaseStatus = LeaseStatus(resp.Header.Get("x-ms-lease-status")) + result.MetaData = metadata.ParseFromHeaders(resp.Header) + + if v := resp.Header.Get("Content-Length"); v != "" { + i, innerErr := strconv.Atoi(v) + if innerErr != nil { + err = fmt.Errorf("parsing `Content-Length` header value %q: %+v", v, innerErr) + } + + result.ContentLength = int64(i) } - result.ContentLength = int64(i) - } + if v := resp.Header.Get("x-ms-access-tier-inferred"); v != "" { + b, innerErr := strconv.ParseBool(v) + if innerErr != nil { + err = fmt.Errorf("parsing `x-ms-access-tier-inferred` header value %q: %+v", v, innerErr) + return + } - if v := resp.Header.Get("x-ms-access-tier-inferred"); v != "" { - b, innerErr := strconv.ParseBool(v) - if innerErr != nil { - err = fmt.Errorf("parsing `x-ms-access-tier-inferred` header value %q: %+v", v, innerErr) - return + result.AccessTierInferred = b } - result.AccessTierInferred = b - } + if v := resp.Header.Get("x-ms-incremental-copy"); v != "" { + b, innerErr := strconv.ParseBool(v) + if innerErr != nil { + err = fmt.Errorf("parsing `x-ms-incremental-copy` header value %q: %+v", v, innerErr) + return + } - if v := resp.Header.Get("x-ms-incremental-copy"); v != "" { - b, innerErr := strconv.ParseBool(v) - if innerErr != nil { - err = fmt.Errorf("parsing `x-ms-incremental-copy` header value %q: %+v", v, innerErr) - return + result.IncrementalCopy = b } - result.IncrementalCopy = b - } + if v := resp.Header.Get("x-ms-server-encrypted"); v != "" { + b, innerErr := strconv.ParseBool(v) + if innerErr != nil { + err = fmt.Errorf("parsing `\"x-ms-server-encrypted` header value %q: %+v", v, innerErr) + return + } - if v := resp.Header.Get("x-ms-server-encrypted"); v != "" { - b, innerErr := strconv.ParseBool(v) - if innerErr != nil { - err = fmt.Errorf("parsing `\"x-ms-server-encrypted` header value %q: %+v", v, innerErr) - return + result.ServerEncrypted = b } - - result.ServerEncrypted = b } } } diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/containers/get_properties.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/containers/get_properties.go index dab47b4b042a..89d6e67efa74 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/containers/get_properties.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/containers/get_properties.go @@ -50,29 +50,31 @@ func (c Client) GetProperties(ctx context.Context, containerName string, input G if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.DefaultEncryptionScope = resp.Header.Get("x-ms-default-encryption-scope") - result.LeaseStatus = LeaseStatus(resp.Header.Get("x-ms-lease-status")) - result.LeaseState = LeaseState(resp.Header.Get("x-ms-lease-state")) - if result.LeaseStatus == Locked { - duration := LeaseDuration(resp.Header.Get("x-ms-lease-duration")) - result.LeaseDuration = &duration + if err == nil { + if resp.Header != nil { + result.DefaultEncryptionScope = resp.Header.Get("x-ms-default-encryption-scope") + result.LeaseStatus = LeaseStatus(resp.Header.Get("x-ms-lease-status")) + result.LeaseState = LeaseState(resp.Header.Get("x-ms-lease-state")) + if result.LeaseStatus == Locked { + duration := LeaseDuration(resp.Header.Get("x-ms-lease-duration")) + result.LeaseDuration = &duration + } + + // If this header is not returned in the response, the container is private to the account owner. + accessLevel := resp.Header.Get("x-ms-blob-public-access") + if accessLevel != "" { + result.AccessLevel = AccessLevel(accessLevel) + } else { + result.AccessLevel = Private + } + + // we can't necessarily use strconv.ParseBool here since this could be nil (only in some API versions) + result.EncryptionScopeOverrideDisabled = strings.EqualFold(resp.Header.Get("x-ms-deny-encryption-scope-override"), "true") + result.HasImmutabilityPolicy = strings.EqualFold(resp.Header.Get("x-ms-has-immutability-policy"), "true") + result.HasLegalHold = strings.EqualFold(resp.Header.Get("x-ms-has-legal-hold"), "true") + + result.MetaData = metadata.ParseFromHeaders(resp.Header) } - - // If this header is not returned in the response, the container is private to the account owner. - accessLevel := resp.Header.Get("x-ms-blob-public-access") - if accessLevel != "" { - result.AccessLevel = AccessLevel(accessLevel) - } else { - result.AccessLevel = Private - } - - // we can't necessarily use strconv.ParseBool here since this could be nil (only in some API versions) - result.EncryptionScopeOverrideDisabled = strings.EqualFold(resp.Header.Get("x-ms-deny-encryption-scope-override"), "true") - result.HasImmutabilityPolicy = strings.EqualFold(resp.Header.Get("x-ms-has-immutability-policy"), "true") - result.HasLegalHold = strings.EqualFold(resp.Header.Get("x-ms-has-legal-hold"), "true") - - result.MetaData = metadata.ParseFromHeaders(resp.Header) } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/containers/lease_acquire.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/containers/lease_acquire.go index 1a2fc9dc5bca..102e689db99c 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/containers/lease_acquire.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/containers/lease_acquire.go @@ -60,8 +60,10 @@ func (c Client) AcquireLease(ctx context.Context, containerName string, input Ac if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.LeaseID = resp.Header.Get("x-ms-lease-id") + if err == nil { + if resp.Header != nil { + result.LeaseID = resp.Header.Get("x-ms-lease-id") + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/containers/lease_break.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/containers/lease_break.go index db913931223e..356068e55dc1 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/containers/lease_break.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/containers/lease_break.go @@ -67,10 +67,12 @@ func (c Client) BreakLease(ctx context.Context, containerName string, input Brea if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - if leaseTimeRaw := resp.Header.Get("x-ms-lease-time"); leaseTimeRaw != "" { - if leaseTime, err := strconv.Atoi(leaseTimeRaw); err == nil { - result.LeaseTime = leaseTime + if err == nil { + if resp.Header != nil { + if leaseTimeRaw := resp.Header.Get("x-ms-lease-time"); leaseTimeRaw != "" { + if leaseTime, err := strconv.Atoi(leaseTimeRaw); err == nil { + result.LeaseTime = leaseTime + } } } } diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/containers/lease_change.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/containers/lease_change.go index fe0ae9bd3b47..89d5e503909b 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/containers/lease_change.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/containers/lease_change.go @@ -62,8 +62,10 @@ func (c Client) ChangeLease(ctx context.Context, containerName string, input Cha if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.LeaseID = resp.Header.Get("x-ms-lease-id") + if err == nil { + if resp.Header != nil { + result.LeaseID = resp.Header.Get("x-ms-lease-id") + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/containers/list_blobs.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/containers/list_blobs.go index 009b77e9a65f..c6d0546723c2 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/containers/list_blobs.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/containers/list_blobs.go @@ -117,10 +117,12 @@ func (c Client) ListBlobs(ctx context.Context, containerName string, input ListB if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - err = resp.Unmarshal(&result) - if err != nil { - err = fmt.Errorf("unmarshalling response: %+v", err) - return + if err == nil { + err = resp.Unmarshal(&result) + if err != nil { + err = fmt.Errorf("unmarshalling response: %+v", err) + return + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/datalakestore/filesystems/properties_get.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/datalakestore/filesystems/properties_get.go index eae1c95d34e0..5bd7f10f593a 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/datalakestore/filesystems/properties_get.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/datalakestore/filesystems/properties_get.go @@ -53,18 +53,20 @@ func (c Client) GetProperties(ctx context.Context, fileSystemName string) (resul if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.DefaultEncryptionScope = resp.Header.Get("x-ms-default-encryption-scope") + if err == nil { + if resp.Header != nil { + result.DefaultEncryptionScope = resp.Header.Get("x-ms-default-encryption-scope") - propertiesRaw := resp.Header.Get("x-ms-properties") - var properties *map[string]string - properties, err = parseProperties(propertiesRaw) - if err != nil { - return - } + propertiesRaw := resp.Header.Get("x-ms-properties") + var properties *map[string]string + properties, err = parseProperties(propertiesRaw) + if err != nil { + return + } - result.Properties = *properties - result.NamespaceEnabled = strings.EqualFold(resp.Header.Get("x-ms-namespace-enabled"), "true") + result.Properties = *properties + result.NamespaceEnabled = strings.EqualFold(resp.Header.Get("x-ms-namespace-enabled"), "true") + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/datalakestore/paths/properties_get.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/datalakestore/paths/properties_get.go index 9f620e8b471d..c8835eecafcb 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/datalakestore/paths/properties_get.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/datalakestore/paths/properties_get.go @@ -65,21 +65,23 @@ func (c Client) GetProperties(ctx context.Context, fileSystemName string, path s if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.ResourceType = PathResource(resp.Header.Get("x-ms-resource-type")) - result.ETag = resp.Header.Get("ETag") - - if lastModifiedRaw := resp.Header.Get("Last-Modified"); lastModifiedRaw != "" { - lastModified, err := time.Parse(time.RFC1123, lastModifiedRaw) - if err != nil { - return GetPropertiesResponse{}, err + if err == nil { + if resp.Header != nil { + result.ResourceType = PathResource(resp.Header.Get("x-ms-resource-type")) + result.ETag = resp.Header.Get("ETag") + + if lastModifiedRaw := resp.Header.Get("Last-Modified"); lastModifiedRaw != "" { + lastModified, err := time.Parse(time.RFC1123, lastModifiedRaw) + if err != nil { + return GetPropertiesResponse{}, err + } + result.LastModified = lastModified } - result.LastModified = lastModified - } - result.Owner = resp.Header.Get("x-ms-owner") - result.Group = resp.Header.Get("x-ms-group") - result.ACL = resp.Header.Get("x-ms-acl") + result.Owner = resp.Header.Get("x-ms-owner") + result.Group = resp.Header.Get("x-ms-group") + result.ACL = resp.Header.Get("x-ms-acl") + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/directories/get.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/directories/get.go index b49444a12b86..8d29b77d91c3 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/directories/get.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/directories/get.go @@ -60,9 +60,11 @@ func (c Client) Get(ctx context.Context, shareName, path string) (result GetResp if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.DirectoryMetaDataEncrypted = strings.EqualFold(resp.Header.Get("x-ms-server-encrypted"), "true") - result.MetaData = metadata.ParseFromHeaders(resp.Header) + if err == nil { + if resp.Header != nil { + result.DirectoryMetaDataEncrypted = strings.EqualFold(resp.Header.Get("x-ms-server-encrypted"), "true") + result.MetaData = metadata.ParseFromHeaders(resp.Header) + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/directories/metadata_get.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/directories/metadata_get.go index aa6e0acf82fd..5ebcae1d7097 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/directories/metadata_get.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/directories/metadata_get.go @@ -55,8 +55,10 @@ func (c Client) GetMetaData(ctx context.Context, shareName, path string) (result if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.MetaData = metadata.ParseFromHeaders(resp.Header) + if err == nil { + if resp.Header != nil { + result.MetaData = metadata.ParseFromHeaders(resp.Header) + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/files/copy.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/files/copy.go index 256244317b41..dacfd2602360 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/files/copy.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/files/copy.go @@ -89,9 +89,11 @@ func (c Client) Copy(ctx context.Context, shareName, path, fileName string, inpu if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.CopyID = resp.Header.Get("x-ms-copy-id") - result.CopySuccess = resp.Header.Get("x-ms-copy-status") + if err == nil { + if resp.Header != nil { + result.CopyID = resp.Header.Get("x-ms-copy-id") + result.CopySuccess = resp.Header.Get("x-ms-copy-status") + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/files/metadata_get.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/files/metadata_get.go index ca88c3cdc47d..3df483eab78c 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/files/metadata_get.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/files/metadata_get.go @@ -59,8 +59,10 @@ func (c Client) GetMetaData(ctx context.Context, shareName, path, fileName strin if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.MetaData = metadata.ParseFromHeaders(resp.Header) + if err == nil { + if resp.Header != nil { + result.MetaData = metadata.ParseFromHeaders(resp.Header) + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/files/properties_get.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/files/properties_get.go index fa5fbc34ee0b..488d2058882b 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/files/properties_get.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/files/properties_get.go @@ -74,32 +74,34 @@ func (c Client) GetProperties(ctx context.Context, shareName, path, fileName str if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.CacheControl = resp.Header.Get("Cache-Control") - result.ContentDisposition = resp.Header.Get("Content-Disposition") - result.ContentEncoding = resp.Header.Get("Content-Encoding") - result.ContentLanguage = resp.Header.Get("Content-Language") - result.ContentMD5 = resp.Header.Get("Content-MD5") - result.ContentType = resp.Header.Get("Content-Type") - result.CopyCompletionTime = resp.Header.Get("x-ms-copy-completion-time") - result.CopyID = resp.Header.Get("x-ms-copy-id") - result.CopyProgress = resp.Header.Get("x-ms-copy-progress") - result.CopySource = resp.Header.Get("x-ms-copy-source") - result.CopyStatus = resp.Header.Get("x-ms-copy-status") - result.CopyStatusDescription = resp.Header.Get("x-ms-copy-status-description") - result.Encrypted = strings.EqualFold(resp.Header.Get("x-ms-server-encrypted"), "true") - result.MetaData = metadata.ParseFromHeaders(resp.Header) + if err == nil { + if resp.Header != nil { + result.CacheControl = resp.Header.Get("Cache-Control") + result.ContentDisposition = resp.Header.Get("Content-Disposition") + result.ContentEncoding = resp.Header.Get("Content-Encoding") + result.ContentLanguage = resp.Header.Get("Content-Language") + result.ContentMD5 = resp.Header.Get("Content-MD5") + result.ContentType = resp.Header.Get("Content-Type") + result.CopyCompletionTime = resp.Header.Get("x-ms-copy-completion-time") + result.CopyID = resp.Header.Get("x-ms-copy-id") + result.CopyProgress = resp.Header.Get("x-ms-copy-progress") + result.CopySource = resp.Header.Get("x-ms-copy-source") + result.CopyStatus = resp.Header.Get("x-ms-copy-status") + result.CopyStatusDescription = resp.Header.Get("x-ms-copy-status-description") + result.Encrypted = strings.EqualFold(resp.Header.Get("x-ms-server-encrypted"), "true") + result.MetaData = metadata.ParseFromHeaders(resp.Header) - contentLengthRaw := resp.Header.Get("Content-Length") - if contentLengthRaw != "" { - var contentLength int - contentLength, err = strconv.Atoi(contentLengthRaw) - if err != nil { - err = fmt.Errorf("parsing `Content-Length` header value %q: %s", contentLengthRaw, err) - return + contentLengthRaw := resp.Header.Get("Content-Length") + if contentLengthRaw != "" { + var contentLength int + contentLength, err = strconv.Atoi(contentLengthRaw) + if err != nil { + err = fmt.Errorf("parsing `Content-Length` header value %q: %s", contentLengthRaw, err) + return + } + contentLengthI64 := int64(contentLength) + result.ContentLength = &contentLengthI64 } - contentLengthI64 := int64(contentLength) - result.ContentLength = &contentLengthI64 } } } diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/files/range_get.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/files/range_get.go index 7d2d4c5d1a2e..39107393bc09 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/files/range_get.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/files/range_get.go @@ -87,16 +87,18 @@ func (c Client) GetByteRange(ctx context.Context, shareName, path, fileName stri if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - result.Contents = &[]byte{} - if resp.Body != nil { - respBody, err := io.ReadAll(resp.Body) - defer resp.Body.Close() - if err != nil { - return result, fmt.Errorf("could not parse response body") - } - - if respBody != nil { - result.Contents = pointer.To(respBody) + if err == nil { + result.Contents = &[]byte{} + if resp.Body != nil { + respBody, err := io.ReadAll(resp.Body) + defer resp.Body.Close() + if err != nil { + return result, fmt.Errorf("could not parse response body") + } + + if respBody != nil { + result.Contents = pointer.To(respBody) + } } } } diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/files/ranges_list.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/files/ranges_list.go index d6b1df41faa5..91a3a253ff6f 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/files/ranges_list.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/files/ranges_list.go @@ -68,10 +68,12 @@ func (c Client) ListRanges(ctx context.Context, shareName, path, fileName string if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - err = resp.Unmarshal(&result) - if err != nil { - err = fmt.Errorf("unmarshalling response: %+v", err) - return + if err == nil { + err = resp.Unmarshal(&result) + if err != nil { + err = fmt.Errorf("unmarshalling response: %+v", err) + return + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/shares/acl_get.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/shares/acl_get.go index 2c9c5eac6103..8231161cacc1 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/shares/acl_get.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/shares/acl_get.go @@ -48,10 +48,12 @@ func (c Client) GetACL(ctx context.Context, shareName string) (result GetACLResu if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - err = resp.Unmarshal(&result) - if err != nil { - err = fmt.Errorf("unmarshalling response: %+v", err) - return + if err == nil { + err = resp.Unmarshal(&result) + if err != nil { + err = fmt.Errorf("unmarshalling response: %+v", err) + return + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/shares/metadata_get.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/shares/metadata_get.go index ae34b3d752ed..c659656f995d 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/shares/metadata_get.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/shares/metadata_get.go @@ -47,8 +47,10 @@ func (c Client) GetMetaData(ctx context.Context, shareName string) (result GetMe if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.MetaData = metadata.ParseFromHeaders(resp.Header) + if err == nil { + if resp.Header != nil { + result.MetaData = metadata.ParseFromHeaders(resp.Header) + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/shares/properties_get.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/shares/properties_get.go index d33b4717a15d..dfdf28c74c0b 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/shares/properties_get.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/shares/properties_get.go @@ -53,29 +53,31 @@ func (c Client) GetProperties(ctx context.Context, shareName string) (result Get if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.MetaData = metadata.ParseFromHeaders(resp.Header) + if err == nil { + if resp.Header != nil { + result.MetaData = metadata.ParseFromHeaders(resp.Header) - quotaRaw := resp.Header.Get("x-ms-share-quota") - if quotaRaw != "" { - quota, e := strconv.Atoi(quotaRaw) - if e != nil { - err = fmt.Errorf("error converting %q to an integer: %s", quotaRaw, err) - return + quotaRaw := resp.Header.Get("x-ms-share-quota") + if quotaRaw != "" { + quota, e := strconv.Atoi(quotaRaw) + if e != nil { + err = fmt.Errorf("error converting %q to an integer: %s", quotaRaw, err) + return + } + result.QuotaInGB = quota } - result.QuotaInGB = quota - } - protocol := SMB - if protocolRaw := resp.Header.Get("x-ms-enabled-protocols"); protocolRaw != "" { - protocol = ShareProtocol(protocolRaw) - } + protocol := SMB + if protocolRaw := resp.Header.Get("x-ms-enabled-protocols"); protocolRaw != "" { + protocol = ShareProtocol(protocolRaw) + } - if accessTierRaw := resp.Header.Get("x-ms-access-tier"); accessTierRaw != "" { - tier := AccessTier(accessTierRaw) - result.AccessTier = &tier + if accessTierRaw := resp.Header.Get("x-ms-access-tier"); accessTierRaw != "" { + tier := AccessTier(accessTierRaw) + result.AccessTier = &tier + } + result.EnabledProtocol = protocol } - result.EnabledProtocol = protocol } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/shares/snapshot_create.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/shares/snapshot_create.go index 6de6e431c953..d8982320f4c0 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/shares/snapshot_create.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/shares/snapshot_create.go @@ -67,8 +67,10 @@ func (c Client) CreateSnapshot(ctx context.Context, shareName string, input Crea if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.SnapshotDateTime = resp.Header.Get("x-ms-snapshot") + if err == nil { + if resp.Header != nil { + result.SnapshotDateTime = resp.Header.Get("x-ms-snapshot") + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/shares/snapshot_get.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/shares/snapshot_get.go index cde1d2fb10b3..bd2408aa7575 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/shares/snapshot_get.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/file/shares/snapshot_get.go @@ -61,8 +61,10 @@ func (c Client) GetSnapshot(ctx context.Context, shareName string, input GetSnap if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.MetaData = metadata.ParseFromHeaders(resp.Header) + if err == nil { + if resp.Header != nil { + result.MetaData = metadata.ParseFromHeaders(resp.Header) + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/queue/queues/metadata_get.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/queue/queues/metadata_get.go index dc70d8eff7a2..a05f85128fa9 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/queue/queues/metadata_get.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/queue/queues/metadata_get.go @@ -49,8 +49,10 @@ func (c Client) GetMetaData(ctx context.Context, queueName string) (result GetMe if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - if resp.Header != nil { - result.MetaData = metadata.ParseFromHeaders(resp.Header) + if err == nil { + if resp.Header != nil { + result.MetaData = metadata.ParseFromHeaders(resp.Header) + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/queue/queues/properties_get.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/queue/queues/properties_get.go index ec250a559fc3..13ee2731587e 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/queue/queues/properties_get.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/queue/queues/properties_get.go @@ -38,10 +38,12 @@ func (c Client) GetServiceProperties(ctx context.Context) (result GetStorageServ if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - err = resp.Unmarshal(&result) - if err != nil { - err = fmt.Errorf("unmarshalling response: %+v", err) - return + if err == nil { + err = resp.Unmarshal(&result) + if err != nil { + err = fmt.Errorf("unmarshalling response: %+v", err) + return + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/table/entities/get.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/table/entities/get.go index cb92d8b2b025..18270342d008 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/table/entities/get.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/table/entities/get.go @@ -59,10 +59,12 @@ func (c Client) Get(ctx context.Context, tableName string, input GetEntityInput) if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - err = resp.Unmarshal(&result.Entity) - if err != nil { - err = fmt.Errorf("unmarshalling response: %+v", err) - return + if err == nil { + err = resp.Unmarshal(&result.Entity) + if err != nil { + err = fmt.Errorf("unmarshalling response: %+v", err) + return + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/table/entities/query.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/table/entities/query.go index 3e3d75afe6b4..dd13b2ab38c5 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/table/entities/query.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/table/entities/query.go @@ -87,10 +87,12 @@ func (c Client) Query(ctx context.Context, tableName string, input QueryEntities if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - err = resp.Unmarshal(&result) - if err != nil { - err = fmt.Errorf("unmarshalling response: %+v", err) - return + if err == nil { + err = resp.Unmarshal(&result) + if err != nil { + err = fmt.Errorf("unmarshalling response: %+v", err) + return + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/table/tables/acl_get.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/table/tables/acl_get.go index dc34659ed30f..dc3e0e6d9e43 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/table/tables/acl_get.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/table/tables/acl_get.go @@ -44,10 +44,12 @@ func (c Client) GetACL(ctx context.Context, tableName string) (result GetACLResp if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - err = resp.Unmarshal(&result) - if err != nil { - err = fmt.Errorf("unmarshalling response: %+v", err) - return + if err == nil { + err = resp.Unmarshal(&result) + if err != nil { + err = fmt.Errorf("unmarshalling response: %+v", err) + return + } } } if err != nil { diff --git a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/table/tables/query.go b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/table/tables/query.go index 92134e99dc1a..5a7dfa9574cf 100644 --- a/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/table/tables/query.go +++ b/vendor/github.com/tombuildsstuff/giovanni/storage/2023-11-03/table/tables/query.go @@ -45,10 +45,12 @@ func (c Client) Query(ctx context.Context, input QueryInput) (result GetResponse if resp != nil && resp.Response != nil { result.HttpResponse = resp.Response - err = resp.Unmarshal(&result) - if err != nil { - err = fmt.Errorf("unmarshalling response: %+v", err) - return + if err == nil { + err = resp.Unmarshal(&result) + if err != nil { + err = fmt.Errorf("unmarshalling response: %+v", err) + return + } } } if err != nil { diff --git a/vendor/modules.txt b/vendor/modules.txt index b171a584538e..afa84e1d9a71 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1083,7 +1083,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.20240417.1084633 +# github.com/hashicorp/go-azure-sdk/sdk v0.20240422.1112441 ## explicit; go 1.21 github.com/hashicorp/go-azure-sdk/sdk/auth github.com/hashicorp/go-azure-sdk/sdk/auth/autorest @@ -1282,7 +1282,7 @@ github.com/rickb777/plural # github.com/sergi/go-diff v1.2.0 ## explicit; go 1.12 github.com/sergi/go-diff/diffmatchpatch -# github.com/tombuildsstuff/giovanni v0.26.1 +# github.com/tombuildsstuff/giovanni v0.27.0 ## explicit; go 1.21 github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/accounts github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/blobs