From d48d57bbc050e6bd1fdb53a30c38950ee69778dd Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Tue, 27 Jul 2021 01:14:29 +0000 Subject: [PATCH] fix clash on azureBlobStorageData (#4964) Signed-off-by: Modular Magician --- .changelog/4964.txt | 3 +++ google/resource_storage_transfer_job.go | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 .changelog/4964.txt diff --git a/.changelog/4964.txt b/.changelog/4964.txt new file mode 100644 index 00000000000..09331a7ac28 --- /dev/null +++ b/.changelog/4964.txt @@ -0,0 +1,3 @@ +```release-note:bug +Fixed a crash on `azure_blob_storage_data_source` for `google_storage_transfer_job` +``` diff --git a/google/resource_storage_transfer_job.go b/google/resource_storage_transfer_job.go index e3a50985e90..353313a770b 100644 --- a/google/resource_storage_transfer_job.go +++ b/google/resource_storage_transfer_job.go @@ -842,6 +842,11 @@ func expandAzureBlobStorageData(azureBlobStorageDatas []interface{}) *storagetra } azureBlobStorageData := azureBlobStorageDatas[0].(map[string]interface{}) + + if azureBlobStorageData["sas_token"] == nil { + log.Printf("[DEBUG] sas_token is not found") + return nil + } return &storagetransfer.AzureBlobStorageData{ Container: azureBlobStorageData["container"].(string), Path: azureBlobStorageData["path"].(string),