Fix wrong field name in detach_disk (#3269)

<!-- This change is generated by MagicModules. -->
/cc @rileykarson
This commit is contained in:
The Magician 2019-03-20 13:02:10 -07:00 committed by Riley Karson
parent 6cbd6146a3
commit 01e7a95eab
2 changed files with 4 additions and 4 deletions

View File

@ -768,8 +768,8 @@ func resourceComputeDiskDelete(d *schema.ResourceData, meta interface{}) error {
return handleNotFoundError(err, d, fmt.Sprintf("ComputeDisk %q", d.Id()))
}
// if disks are attached, they must be detached before the disk can be deleted
if v, ok := readRes["instances"].([]interface{}); ok {
// if disks are attached to instances, they must be detached before the disk can be deleted
if v, ok := readRes["users"].([]interface{}); ok {
type detachArgs struct{ project, zone, instance, deviceName string }
var detachCalls []detachArgs

View File

@ -503,8 +503,8 @@ func resourceComputeRegionDiskDelete(d *schema.ResourceData, meta interface{}) e
return handleNotFoundError(err, d, fmt.Sprintf("ComputeDisk %q", d.Id()))
}
// if disks are attached, they must be detached before the disk can be deleted
if v, ok := readRes["instances"].([]interface{}); ok {
// if disks are attached to instances, they must be detached before the disk can be deleted
if v, ok := readRes["users"].([]interface{}); ok {
type detachArgs struct{ project, zone, instance, deviceName string }
var detachCalls []detachArgs