diff --git a/changelogs/unreleased/404-akhilerm b/changelogs/unreleased/404-akhilerm new file mode 100644 index 000000000..d5f236f6c --- /dev/null +++ b/changelogs/unreleased/404-akhilerm @@ -0,0 +1 @@ +add additional check to exclude blockdevices with tag while manual claiming diff --git a/pkg/select/blockdevice/select.go b/pkg/select/blockdevice/select.go index 8d19d691f..923404704 100644 --- a/pkg/select/blockdevice/select.go +++ b/pkg/select/blockdevice/select.go @@ -47,17 +47,21 @@ func (c *Config) getCandidateDevices(bdList *apis.BlockDeviceList) (*apis.BlockD FilterUnclaimed, // do not consider any devices with legacy annotation for claiming FilterOutLegacyAnnotation, + // remove block devices which do not have the blockdevice tag + // if selector is present on the BDC, select only those devices + // this applies to both manual and auto claiming. + FilterBlockDeviceTag, } if c.ManualSelection { - filterKeys = append(filterKeys, FilterBlockDeviceName) + filterKeys = append(filterKeys, + FilterBlockDeviceName, + ) } else { filterKeys = append(filterKeys, // Sparse BDs can be claimed only by manual selection. Therefore, all // sparse BDs will be filtered out in auto mode FilterOutSparseBlockDevices, - // remove block devices which do not have the blockdevice tag - FilterBlockDeviceTag, FilterDeviceType, FilterVolumeMode, FilterNodeName,