mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +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
@ -68,7 +68,7 @@ func (rscs *ReclaimSpaceControllerServer) ControllerReclaimSpace(
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Aborted, "failed to find volume with ID %q: %s", volumeID, err.Error())
|
||||
}
|
||||
defer rbdVol.Destroy()
|
||||
defer rbdVol.Destroy(ctx)
|
||||
|
||||
err = rbdVol.Sparsify()
|
||||
if errors.Is(err, rbdutil.ErrImageInUse) {
|
||||
|
@ -273,7 +273,7 @@ func (rs *ReplicationServer) EnableVolumeReplication(ctx context.Context,
|
||||
rbdVol, err := corerbd.GenVolFromVolID(ctx, volumeID, cr, req.GetSecrets())
|
||||
defer func() {
|
||||
if rbdVol != nil {
|
||||
rbdVol.Destroy()
|
||||
rbdVol.Destroy(ctx)
|
||||
}
|
||||
}()
|
||||
if err != nil {
|
||||
@ -350,7 +350,7 @@ func (rs *ReplicationServer) DisableVolumeReplication(ctx context.Context,
|
||||
rbdVol, err := corerbd.GenVolFromVolID(ctx, volumeID, cr, req.GetSecrets())
|
||||
defer func() {
|
||||
if rbdVol != nil {
|
||||
rbdVol.Destroy()
|
||||
rbdVol.Destroy(ctx)
|
||||
}
|
||||
}()
|
||||
if err != nil {
|
||||
@ -425,7 +425,7 @@ func (rs *ReplicationServer) PromoteVolume(ctx context.Context,
|
||||
rbdVol, err := corerbd.GenVolFromVolID(ctx, volumeID, cr, req.GetSecrets())
|
||||
defer func() {
|
||||
if rbdVol != nil {
|
||||
rbdVol.Destroy()
|
||||
rbdVol.Destroy(ctx)
|
||||
}
|
||||
}()
|
||||
if err != nil {
|
||||
@ -525,7 +525,7 @@ func (rs *ReplicationServer) DemoteVolume(ctx context.Context,
|
||||
rbdVol, err := corerbd.GenVolFromVolID(ctx, volumeID, cr, req.GetSecrets())
|
||||
defer func() {
|
||||
if rbdVol != nil {
|
||||
rbdVol.Destroy()
|
||||
rbdVol.Destroy(ctx)
|
||||
}
|
||||
}()
|
||||
if err != nil {
|
||||
@ -642,7 +642,7 @@ func (rs *ReplicationServer) ResyncVolume(ctx context.Context,
|
||||
rbdVol, err := corerbd.GenVolFromVolID(ctx, volumeID, cr, req.GetSecrets())
|
||||
defer func() {
|
||||
if rbdVol != nil {
|
||||
rbdVol.Destroy()
|
||||
rbdVol.Destroy(ctx)
|
||||
}
|
||||
}()
|
||||
if err != nil {
|
||||
@ -856,7 +856,7 @@ func (rs *ReplicationServer) GetVolumeReplicationInfo(ctx context.Context,
|
||||
rbdVol, err := corerbd.GenVolFromVolID(ctx, volumeID, cr, req.GetSecrets())
|
||||
defer func() {
|
||||
if rbdVol != nil {
|
||||
rbdVol.Destroy()
|
||||
rbdVol.Destroy(ctx)
|
||||
}
|
||||
}()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user