diff --git a/internal/cephfs/clone.go b/internal/cephfs/clone.go index dc2b32b39..2151fc471 100644 --- a/internal/cephfs/clone.go +++ b/internal/cephfs/clone.go @@ -58,7 +58,7 @@ func createCloneFromSubvolume(ctx context.Context, volID, cloneID volumeID, volO ) defer func() { if protectErr != nil { - err = parentvolOpt.deleteSnapshot(ctx, cr, snapshotID, volID) + err = parentvolOpt.deleteSnapshot(ctx, snapshotID, volID) if err != nil { util.ErrorLog(ctx, "failed to delete snapshot %s %v", snapshotID, err) } @@ -76,7 +76,7 @@ func createCloneFromSubvolume(ctx context.Context, volID, cloneID volumeID, volO util.ErrorLog(ctx, "failed to unprotect snapshot %s %v", snapshotID, err) } } - if err = parentvolOpt.deleteSnapshot(ctx, cr, snapshotID, volID); err != nil { + if err = parentvolOpt.deleteSnapshot(ctx, snapshotID, volID); err != nil { util.ErrorLog(ctx, "failed to delete snapshot %s %v", snapshotID, err) } } @@ -126,7 +126,7 @@ func createCloneFromSubvolume(ctx context.Context, volID, cloneID volumeID, volO return err } } - if err = parentvolOpt.deleteSnapshot(ctx, cr, snapshotID, volID); err != nil { + if err = parentvolOpt.deleteSnapshot(ctx, snapshotID, volID); err != nil { util.ErrorLog(ctx, "failed to delete snapshot %s %v", snapshotID, err) return err } @@ -153,7 +153,7 @@ func cleanupCloneFromSubvolumeSnapshot(ctx context.Context, volID, cloneID volum return err } } - err = parentVolOpt.deleteSnapshot(ctx, cr, snapShotID, volID) + err = parentVolOpt.deleteSnapshot(ctx, snapShotID, volID) if err != nil { util.ErrorLog(ctx, "failed to delete snapshot %s %v", snapShotID, err) return err diff --git a/internal/cephfs/controllerserver.go b/internal/cephfs/controllerserver.go index 978d397ce..6b3d837d7 100644 --- a/internal/cephfs/controllerserver.go +++ b/internal/cephfs/controllerserver.go @@ -594,7 +594,7 @@ func doSnapshot(ctx context.Context, volOpt *volumeOptions, subvolumeName, snaps } defer func() { if err != nil { - dErr := volOpt.deleteSnapshot(ctx, cr, snapID, volID) + dErr := volOpt.deleteSnapshot(ctx, snapID, volID) if dErr != nil { util.ErrorLog(ctx, "failed to delete snapshot %s %v", snapID, err) } @@ -711,7 +711,7 @@ func (cs *ControllerServer) DeleteSnapshot(ctx context.Context, req *csi.DeleteS return nil, status.Error(codes.Internal, err.Error()) } } - err = volOpt.deleteSnapshot(ctx, cr, volumeID(sid.FsSnapshotName), volumeID(sid.FsSubvolName)) + err = volOpt.deleteSnapshot(ctx, volumeID(sid.FsSnapshotName), volumeID(sid.FsSubvolName)) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } diff --git a/internal/cephfs/fsjournal.go b/internal/cephfs/fsjournal.go index 0fcda2c31..cfec0a9ab 100644 --- a/internal/cephfs/fsjournal.go +++ b/internal/cephfs/fsjournal.go @@ -354,7 +354,7 @@ func checkSnapExists( defer func() { if err != nil { - err = volOptions.deleteSnapshot(ctx, cr, volumeID(snapID), volumeID(parentSubVolName)) + err = volOptions.deleteSnapshot(ctx, volumeID(snapID), volumeID(parentSubVolName)) if err != nil { util.ErrorLog(ctx, "failed to delete snapshot %s: %v", snapID, err) return diff --git a/internal/cephfs/snapshot.go b/internal/cephfs/snapshot.go index 87dd7bce7..386d8506f 100644 --- a/internal/cephfs/snapshot.go +++ b/internal/cephfs/snapshot.go @@ -61,7 +61,7 @@ func (vo *volumeOptions) createSnapshot(ctx context.Context, snapID, volID volum return nil } -func (vo *volumeOptions) deleteSnapshot(ctx context.Context, cr *util.Credentials, snapID, volID volumeID) error { +func (vo *volumeOptions) deleteSnapshot(ctx context.Context, snapID, volID volumeID) error { fsa, err := vo.conn.GetFSAdmin() if err != nil { util.ErrorLog(ctx, "could not get FSAdmin: %s", err)