cephfs: remove unused Credentials argument from deleteSnapshot()

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2020-11-04 14:36:14 +01:00 committed by mergify[bot]
parent 9d9b5b3303
commit 294f7b22d4
4 changed files with 8 additions and 8 deletions

View File

@ -58,7 +58,7 @@ func createCloneFromSubvolume(ctx context.Context, volID, cloneID volumeID, volO
) )
defer func() { defer func() {
if protectErr != nil { if protectErr != nil {
err = parentvolOpt.deleteSnapshot(ctx, cr, snapshotID, volID) err = parentvolOpt.deleteSnapshot(ctx, snapshotID, volID)
if err != nil { if err != nil {
util.ErrorLog(ctx, "failed to delete snapshot %s %v", snapshotID, err) 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) 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) 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 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) util.ErrorLog(ctx, "failed to delete snapshot %s %v", snapshotID, err)
return err return err
} }
@ -153,7 +153,7 @@ func cleanupCloneFromSubvolumeSnapshot(ctx context.Context, volID, cloneID volum
return err return err
} }
} }
err = parentVolOpt.deleteSnapshot(ctx, cr, snapShotID, volID) err = parentVolOpt.deleteSnapshot(ctx, snapShotID, volID)
if err != nil { if err != nil {
util.ErrorLog(ctx, "failed to delete snapshot %s %v", snapShotID, err) util.ErrorLog(ctx, "failed to delete snapshot %s %v", snapShotID, err)
return err return err

View File

@ -594,7 +594,7 @@ func doSnapshot(ctx context.Context, volOpt *volumeOptions, subvolumeName, snaps
} }
defer func() { defer func() {
if err != nil { if err != nil {
dErr := volOpt.deleteSnapshot(ctx, cr, snapID, volID) dErr := volOpt.deleteSnapshot(ctx, snapID, volID)
if dErr != nil { if dErr != nil {
util.ErrorLog(ctx, "failed to delete snapshot %s %v", snapID, err) 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()) 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 { if err != nil {
return nil, status.Error(codes.Internal, err.Error()) return nil, status.Error(codes.Internal, err.Error())
} }

View File

@ -354,7 +354,7 @@ func checkSnapExists(
defer func() { defer func() {
if err != nil { if err != nil {
err = volOptions.deleteSnapshot(ctx, cr, volumeID(snapID), volumeID(parentSubVolName)) err = volOptions.deleteSnapshot(ctx, volumeID(snapID), volumeID(parentSubVolName))
if err != nil { if err != nil {
util.ErrorLog(ctx, "failed to delete snapshot %s: %v", snapID, err) util.ErrorLog(ctx, "failed to delete snapshot %s: %v", snapID, err)
return return

View File

@ -61,7 +61,7 @@ func (vo *volumeOptions) createSnapshot(ctx context.Context, snapID, volID volum
return nil 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() fsa, err := vo.conn.GetFSAdmin()
if err != nil { if err != nil {
util.ErrorLog(ctx, "could not get FSAdmin: %s", err) util.ErrorLog(ctx, "could not get FSAdmin: %s", err)