providers/azurerm: don't leak the context cancellation function
This commit is contained in:
parent
61bbaf6f85
commit
d7402d0473
|
@ -193,9 +193,10 @@ func resourceArmStorageAccountCreate(d *schema.ResourceData, meta interface{}) e
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create
|
// Create
|
||||||
cancelCtx, _ := context.WithTimeout(client.StopContext, 1*time.Hour)
|
cancelCtx, cancelFunc := context.WithTimeout(client.StopContext, 1*time.Hour)
|
||||||
_, createErr := storageClient.Create(
|
_, createErr := storageClient.Create(
|
||||||
resourceGroupName, storageAccountName, opts, cancelCtx.Done())
|
resourceGroupName, storageAccountName, opts, cancelCtx.Done())
|
||||||
|
cancelFunc()
|
||||||
|
|
||||||
// The only way to get the ID back apparently is to read the resource again
|
// The only way to get the ID back apparently is to read the resource again
|
||||||
read, err := storageClient.GetProperties(resourceGroupName, storageAccountName)
|
read, err := storageClient.GetProperties(resourceGroupName, storageAccountName)
|
||||||
|
|
Loading…
Reference in New Issue