cleanup: removed unused SnapshotInfo from CheckSnapExists()

Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
Praveen M 2023-10-30 14:15:18 +05:30 committed by mergify[bot]
parent ad3a3d704a
commit c09700b568
2 changed files with 9 additions and 9 deletions

View File

@ -830,7 +830,7 @@ func (cs *ControllerServer) CreateSnapshot(
} }
defer cs.VolumeLocks.Release(sourceVolID) defer cs.VolumeLocks.Release(sourceVolID)
snapName := req.GetName() snapName := req.GetName()
sid, _, err := store.CheckSnapExists(ctx, parentVolOptions, cephfsSnap, cs.ClusterName, cs.SetMetadata, cr) sid, err := store.CheckSnapExists(ctx, parentVolOptions, cephfsSnap, cs.ClusterName, cs.SetMetadata, cr)
if err != nil { if err != nil {
return nil, status.Error(codes.Internal, err.Error()) return nil, status.Error(codes.Internal, err.Error())
} }

View File

@ -398,11 +398,11 @@ func CheckSnapExists(
clusterName string, clusterName string,
setMetadata bool, setMetadata bool,
cr *util.Credentials, cr *util.Credentials,
) (*SnapshotIdentifier, *core.SnapshotInfo, error) { ) (*SnapshotIdentifier, error) {
// Connect to cephfs' default radosNamespace (csi) // Connect to cephfs' default radosNamespace (csi)
j, err := SnapJournal.Connect(volOptions.Monitors, fsutil.RadosNamespace, cr) j, err := SnapJournal.Connect(volOptions.Monitors, fsutil.RadosNamespace, cr)
if err != nil { if err != nil {
return nil, nil, err return nil, err
} }
defer j.Destroy() defer j.Destroy()
@ -411,10 +411,10 @@ func CheckSnapExists(
snapData, err := j.CheckReservation( snapData, err := j.CheckReservation(
ctx, volOptions.MetadataPool, snap.RequestName, snap.NamePrefix, volOptions.VolID, kmsID, encryptionType) ctx, volOptions.MetadataPool, snap.RequestName, snap.NamePrefix, volOptions.VolID, kmsID, encryptionType)
if err != nil { if err != nil {
return nil, nil, err return nil, err
} }
if snapData == nil { if snapData == nil {
return nil, nil, nil return nil, nil
} }
sid := &SnapshotIdentifier{} sid := &SnapshotIdentifier{}
snapUUID := snapData.ImageUUID snapUUID := snapData.ImageUUID
@ -428,10 +428,10 @@ func CheckSnapExists(
err = j.UndoReservation(ctx, volOptions.MetadataPool, err = j.UndoReservation(ctx, volOptions.MetadataPool,
volOptions.MetadataPool, snapID, snap.RequestName) volOptions.MetadataPool, snapID, snap.RequestName)
return nil, nil, err return nil, err
} }
return nil, nil, err return nil, err
} }
defer func() { defer func() {
@ -455,10 +455,10 @@ func CheckSnapExists(
sid.SnapshotID, err = util.GenerateVolID(ctx, volOptions.Monitors, cr, volOptions.FscID, sid.SnapshotID, err = util.GenerateVolID(ctx, volOptions.Monitors, cr, volOptions.FscID,
"", volOptions.ClusterID, snapUUID, fsutil.VolIDVersion) "", volOptions.ClusterID, snapUUID, fsutil.VolIDVersion)
if err != nil { if err != nil {
return nil, nil, err return nil, err
} }
log.DebugLog(ctx, "Found existing snapshot (%s) with subvolume name (%s) for request (%s)", log.DebugLog(ctx, "Found existing snapshot (%s) with subvolume name (%s) for request (%s)",
snapData.ImageAttributes.RequestName, volOptions.VolID, sid.FsSnapshotName) snapData.ImageAttributes.RequestName, volOptions.VolID, sid.FsSnapshotName)
return sid, &snapInfo, nil return sid, nil
} }