Skip to content

Commit

Permalink
fix(filter): add block-device-tag filter during manual claiming (#404)
Browse files Browse the repository at this point in the history
Enforce check on block device tag even for cases where block 
devices are claimed with block device name. 

Signed-off-by: Akhil Mohan <[email protected]>
  • Loading branch information
akhilerm authored and kmova committed Sep 9, 2020
1 parent e69d56f commit 4af5d55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelogs/unreleased/404-akhilerm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add additional check to exclude blockdevices with tag while manual claiming
10 changes: 7 additions & 3 deletions pkg/select/blockdevice/select.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4af5d55

Please sign in to comment.