Skip to content

Commit c63b6a7

Browse files
authored
[PWX-27134] Filter out only disks whos lifecycleState is ATTACHED in (#115)
DeviceMappings() for oracle. Signed-off-by: Vinayak Shinde <vinayakshnd@gmail.com> Signed-off-by: Vinayak Shinde <vinayakshnd@gmail.com>
1 parent 501f7de commit c63b6a7

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

oracle/oracle.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,14 @@ func (o *oracleOps) DeviceMappings() (map[string]string, error) {
331331
return m, err
332332
}
333333
for _, va := range volumeAttachmentResp.Items {
334-
if va.GetDevice() != nil && va.GetVolumeId() != nil {
335-
devicePath = *va.GetDevice()
336-
volID = *va.GetVolumeId()
337-
} else {
338-
logrus.Warnf("Device path or volume id for [%+v] volume attachment not found", va)
339-
continue
334+
if va.GetLifecycleState() == core.VolumeAttachmentLifecycleStateAttached {
335+
if va.GetDevice() != nil && va.GetVolumeId() != nil {
336+
devicePath = *va.GetDevice()
337+
volID = *va.GetVolumeId()
338+
} else {
339+
logrus.Warnf("Device path or volume id for [%+v] volume attachment not found", va)
340+
continue
341+
}
340342
}
341343
m[devicePath] = volID
342344
}

0 commit comments

Comments
 (0)