Skip to content

Commit

Permalink
This commit bumps the Go version to 1.16.5 and also address review co…
Browse files Browse the repository at this point in the history
…mments

Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
  • Loading branch information
mittachaitu committed Dec 2, 2021
1 parent fcee4d5 commit 1d18b12
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/driver/node.go
Expand Up @@ -281,13 +281,14 @@ func (ns *node) NodeUnstageVolume(
// so all the cases are handled
utils.TransitionVolListLock.Lock()
utils.TransitionVolList[volumeID] = apis.CStorVolumeAttachmentStatusUnmountUnderProgress
utils.TransitionVolListLock.Unlock()

if err = iscsiutils.UnmountAndDetachDisk(vol, stagingTargetPath); err != nil {
utils.TransitionVolListLock.Unlock()
return nil, status.Error(codes.Internal, err.Error())
}

utils.TransitionVolListLock.Lock()
utils.TransitionVolList[volumeID] = apis.CStorVolumeAttachmentStatusUnmounted
// It is safe to delete the CStorVolumeAttachment CR now since the volume has already
// been unmounted and logged out
utils.TransitionVolListLock.Unlock()

vol.Finalizers = nil
Expand All @@ -298,6 +299,8 @@ func (ns *node) NodeUnstageVolume(
logrus.Infof("cstor-csi: volume %s path: %s has been unmounted.",
volumeID, stagingTargetPath)

// It is safe to delete the CStorVolumeAttachment CR now since the volume has already
// been unmounted and logged out
if err := utils.DeleteCStorVolumeAttachmentCR(req.GetVolumeId() + "-" + ns.driver.config.NodeID); err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
Expand Down

0 comments on commit 1d18b12

Please sign in to comment.