Skip to content

Commit

Permalink
fix: Hanle the error of vdisk.GetIStorage in syncCloudDisk
Browse files Browse the repository at this point in the history
  • Loading branch information
rainzm committed Jun 9, 2020
1 parent f441306 commit 4c66826
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/compute/models/disks.go
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,10 @@ func (manager *SDiskManager) syncCloudDisk(ctx context.Context, userCred mcclien
diskObj, err := db.FetchByExternalId(manager, vdisk.GetGlobalId())
if err != nil {
if err == sql.ErrNoRows {
vstorage, _ := vdisk.GetIStorage()
vstorage, err := vdisk.GetIStorage()
if err != nil {
return nil, errors.Wrapf(err, "unable to GetIStorage of vdisk %q", vdisk.GetName())
}

storageObj, err := db.FetchByExternalId(StorageManager, vstorage.GetGlobalId())
if err != nil {
Expand Down

0 comments on commit 4c66826

Please sign in to comment.