mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
cleanup: pass context to rbdImage.Destroy()
In the future we'll introduce a more standard interface for objects like Volumes and Snapshots. It is useful to have the context passed as 1st argument to all functions of those objects, including their Destroy() function. Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
d5849a4801
commit
3aece2f38e
@ -198,7 +198,7 @@ func (ns *NodeServer) populateRbdVol(
|
||||
} else {
|
||||
rv, err = GenVolFromVolID(ctx, volID, cr, req.GetSecrets())
|
||||
if err != nil {
|
||||
rv.Destroy()
|
||||
rv.Destroy(ctx)
|
||||
log.ErrorLog(ctx, "error generating volume %s: %v", volID, err)
|
||||
|
||||
return nil, status.Errorf(codes.Internal, "error generating volume %s: %v", volID, err)
|
||||
@ -221,7 +221,7 @@ func (ns *NodeServer) populateRbdVol(
|
||||
// in case of any error call Destroy for cleanup.
|
||||
defer func() {
|
||||
if err != nil {
|
||||
rv.Destroy()
|
||||
rv.Destroy(ctx)
|
||||
}
|
||||
}()
|
||||
// get the image details from the ceph cluster.
|
||||
@ -345,7 +345,7 @@ func (ns *NodeServer) NodeStageVolume(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rv.Destroy()
|
||||
defer rv.Destroy(ctx)
|
||||
|
||||
rv.NetNamespaceFilePath, err = util.GetRBDNetNamespaceFilePath(util.CsiConfigFile, rv.ClusterID)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user