cephfs: replace Errorf with ErrorLog in checkSnapExists

replace Errorf with ErrorLog in checkSnapExists
for context based logging.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2020-08-11 17:39:10 +05:30 committed by mergify[bot]
parent 98e97baa60
commit c57189382f

View File

@ -24,7 +24,6 @@ import (
"github.com/ceph/ceph-csi/internal/util" "github.com/ceph/ceph-csi/internal/util"
"github.com/golang/protobuf/ptypes/timestamp" "github.com/golang/protobuf/ptypes/timestamp"
klog "k8s.io/klog/v2"
) )
// volumeIdentifier structure contains an association between the CSI VolumeID to its subvolume // volumeIdentifier structure contains an association between the CSI VolumeID to its subvolume
@ -354,13 +353,13 @@ func checkSnapExists(
if err != nil { if err != nil {
err = deleteSnapshot(ctx, volOptions, cr, volumeID(snapID), volumeID(parentSubVolName)) err = deleteSnapshot(ctx, volOptions, cr, volumeID(snapID), volumeID(parentSubVolName))
if err != nil { if err != nil {
klog.Errorf(util.Log(ctx, "failed to delete snapshot %s: %v"), snapID, err) util.ErrorLog(ctx, "failed to delete snapshot %s: %v", snapID, err)
return return
} }
err = j.UndoReservation(ctx, volOptions.MetadataPool, err = j.UndoReservation(ctx, volOptions.MetadataPool,
volOptions.MetadataPool, snapID, snap.RequestName) volOptions.MetadataPool, snapID, snap.RequestName)
if err != nil { if err != nil {
klog.Errorf(util.Log(ctx, "removing reservation failed for snapshot %s: %v"), snapID, err) util.ErrorLog(ctx, "removing reservation failed for snapshot %s: %v", snapID, err)
} }
} }
}() }()