Skip to content

Commit

Permalink
fix(controller, probe): fix sysfs probe and controller options
Browse files Browse the repository at this point in the history
- set controller options in device list command
- return sysfs probe to prevent null pointer exception

Signed-off-by: Akhil Mohan <[email protected]>
  • Loading branch information
akhilerm authored and kmova committed Oct 27, 2020
1 parent 3e81357 commit da44e06
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelogs/unreleased/504-akhilerm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add controller options to device list command, fixed sysfs probe processing empty devices
6 changes: 6 additions & 0 deletions cmd/ndm_daemonset/app/command/device-list.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ func deviceList() error {
if err != nil {
return err
}

err = ctrl.SetControllerOptions(options)
if err != nil {
return err
}

// TODO @akhilerm should pass the filter as args to List, so that all devices will be listed
diskList, err := ctrl.ListBlockDeviceResource(false)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions cmd/ndm_daemonset/probe/sysfsprobe.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func (cp *sysfsProbe) FillBlockDeviceDetails(blockDevice *blockdevice.BlockDevic
sysFsDevice, err := sysfs.NewSysFsDeviceFromDevPath(blockDevice.DevPath)
if err != nil {
klog.Errorf("unable to get sysfs device for device: %s, err: %v", blockDevice.DevPath, err)
return
}

if blockDevice.DeviceAttributes.LogicalBlockSize == 0 {
Expand Down

0 comments on commit da44e06

Please sign in to comment.