File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,9 @@ package blockdevice
1818
1919import (
2020 "fmt"
21+
2122 apis "github.com/openebs/node-disk-manager/api/v1alpha1"
23+ "github.com/openebs/node-disk-manager/blockdevice"
2224)
2325
2426// Filter selects a single block device from a list of block devices
@@ -58,10 +60,12 @@ func (c *Config) getCandidateDevices(bdList *apis.BlockDeviceList) (*apis.BlockD
5860 FilterBlockDeviceName ,
5961 )
6062 } else {
63+ if c .ClaimSpec .DeviceType != blockdevice .SparseBlockDeviceType {
64+ // Unless explicitly specify DeviceType as sparse, device sparse will not be included
65+ filterKeys = append (filterKeys , FilterOutSparseBlockDevices )
66+ }
67+
6168 filterKeys = append (filterKeys ,
62- // Sparse BDs can be claimed only by manual selection. Therefore, all
63- // sparse BDs will be filtered out in auto mode
64- FilterOutSparseBlockDevices ,
6569 FilterDeviceType ,
6670 FilterVolumeMode ,
6771 FilterNodeName ,
You can’t perform that action at this time.
0 commit comments