Skip to content

Commit

Permalink
Merge pull request #335 from akutz/bugfix/scaleio-attachment-fix
Browse files Browse the repository at this point in the history
ScaleIO Get Volumes Attachment States Fix
  • Loading branch information
akutz authored Nov 12, 2016
2 parents 5606ff0 + 6c610b5 commit ccdd3a0
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions drivers/storage/scaleio/storage/scaleio_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (d *driver) Volumes(
opts *types.VolumesOpts) ([]*types.Volume, error) {

sdcMappedVolumes := make(map[string]string)
if opts.Attachments.Requested() {
if opts.Attachments.Devices() {
if ld, ok := context.LocalDevices(ctx); ok {
sdcMappedVolumes = ld.DeviceMap
}
Expand Down Expand Up @@ -195,8 +195,8 @@ func (d *driver) Volumes(
return ""
}

if protectionDomain, ok := mapProtectionDomainName[pool.ProtectionDomainID]; ok {
return protectionDomain.Name
if pd, ok := mapProtectionDomainName[pool.ProtectionDomainID]; ok {
return pd.Name
}
return ""
}
Expand All @@ -209,22 +209,22 @@ func (d *driver) Volumes(
var volumesSD []*types.Volume
for _, volume := range volumes {
var attachmentsSD []*types.VolumeAttachment
for _, attachment := range volume.MappedSdcInfo {
var deviceName string
if _, exists := sdcMappedVolumes[volume.ID]; exists {
deviceName = sdcMappedVolumes[volume.ID]
}
instanceID := &types.InstanceID{
ID: attachment.SdcID,
Driver: d.Name(),
if opts.Attachments.Requested() {
for _, attachment := range volume.MappedSdcInfo {
instanceID := &types.InstanceID{
ID: attachment.SdcID,
Driver: d.Name(),
}
attachmentSD := &types.VolumeAttachment{
VolumeID: volume.ID,
InstanceID: instanceID,
Status: "",
}
if devName, ok := sdcMappedVolumes[volume.ID]; ok {
attachmentSD.DeviceName = devName
}
attachmentsSD = append(attachmentsSD, attachmentSD)
}
attachmentSD := &types.VolumeAttachment{
VolumeID: volume.ID,
InstanceID: instanceID,
DeviceName: deviceName,
Status: "",
}
attachmentsSD = append(attachmentsSD, attachmentSD)
}

var IOPS int64
Expand Down

0 comments on commit ccdd3a0

Please sign in to comment.