From af1d01d7fccd9d53d751b7cd70dd4d2c5e63d9dd Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Tue, 27 Jul 2021 01:14:14 +0000 Subject: [PATCH] fix clash on azureBlobStorageData (#4964) Signed-off-by: Modular Magician --- .changelog/4964.txt | 3 +++ google-beta/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 0000000000..09331a7ac2 --- /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-beta/resource_storage_transfer_job.go b/google-beta/resource_storage_transfer_job.go index e3a50985e9..353313a770 100644 --- a/google-beta/resource_storage_transfer_job.go +++ b/google-beta/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),