Fix gce.getDiskByNameUnknownZone logic.

pull/6/head
Alex Robinson 2016-04-18 22:53:15 -07:00
parent 5abbc24a86
commit d69ccd5c8c
1 changed files with 5 additions and 0 deletions

View File

@ -2245,6 +2245,11 @@ func (gce *GCECloud) getDiskByNameUnknownZone(diskName string) (*gceDisk, error)
if err != nil {
return nil, err
}
// findDiskByName returns (nil,nil) if the disk doesn't exist, so we can't
// assume that a disk was found unless disk is non-nil.
if disk == nil {
continue
}
if found != nil {
return nil, fmt.Errorf("GCE persistent disk name was found in multiple zones: %q", diskName)
}