Skip to content

Commit

Permalink
fix(probe): update bd cache after generating uuid (#602)
Browse files Browse the repository at this point in the history
when adding a blockdevice, the information stroed in the controller
cache does not contain the the up-to-date uuid of the bd generated while
adding the bd. Update the bd cache with the new uuid after generation.

Signed-off-by: Aditya Jain <aditya.jainadityajain.jain@gmail.com>
  • Loading branch information
z0marlin committed Jul 8, 2021
1 parent d6c57f0 commit e9ce0d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/unreleased/602-z0marlin
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix add-handler to update controller blockdevice cache after generating uuid

2 changes: 2 additions & 0 deletions cmd/ndm_daemonset/probe/addhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ func (pe *ProbeEvent) addBlockDevice(bd blockdevice.BlockDevice, bdAPIList *apis
} else {
bd.UUID = uuid
klog.V(4).Infof("uuid: %s has been generated for device: %s", uuid, bd.DevPath)
// update cache after generating uuid
pe.addBlockDeviceToHierarchyCache(bd)
bdAPI, err := pe.Controller.GetBlockDevice(uuid)

if errors.IsNotFound(err) {
Expand Down

0 comments on commit e9ce0d7

Please sign in to comment.