Merge pull request #9542 from brendandburns/validate
Change the way we test if a disk is already attached.
This commit is contained in:
@@ -699,7 +699,7 @@ func (gce *GCECloud) AttachDisk(diskName string, readOnly bool) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for _, disk := range instance.Disks {
|
for _, disk := range instance.Disks {
|
||||||
if disk.InitializeParams.DiskName == diskName {
|
if disk.Source == attachedDisk.Source {
|
||||||
// Disk is already attached, we're good to go.
|
// Disk is already attached, we're good to go.
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user