mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-17 20:00:23 +00:00
cephfs: replace klog.Warningf with util.WarningLog in deleteSnapshot
replace klog.Warningf with util.WarningLog in deleteSnapshot for context based logging. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
7eefadf1eb
commit
20dbbe54b0
@ -29,7 +29,6 @@ import (
|
|||||||
"github.com/kubernetes-csi/csi-lib-utils/protosanitizer"
|
"github.com/kubernetes-csi/csi-lib-utils/protosanitizer"
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
klog "k8s.io/klog/v2"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ControllerServer struct of CEPH CSI driver with supported methods of CSI
|
// ControllerServer struct of CEPH CSI driver with supported methods of CSI
|
||||||
@ -465,7 +464,7 @@ func (cs *ControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateS
|
|||||||
parentVolOptions, vid, err := newVolumeOptionsFromVolID(ctx, sourceVolID, nil, req.GetSecrets())
|
parentVolOptions, vid, err := newVolumeOptionsFromVolID(ctx, sourceVolID, nil, req.GetSecrets())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, util.ErrPoolNotFound) {
|
if errors.Is(err, util.ErrPoolNotFound) {
|
||||||
klog.Warningf(util.Log(ctx, "failed to get backend volume for %s: %v"), sourceVolID, err)
|
util.WarningLog(ctx, "failed to get backend volume for %s: %v", sourceVolID, err)
|
||||||
return nil, status.Error(codes.NotFound, err.Error())
|
return nil, status.Error(codes.NotFound, err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -513,7 +512,7 @@ func (cs *ControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateS
|
|||||||
if sid != nil {
|
if sid != nil {
|
||||||
errDefer := undoSnapReservation(ctx, parentVolOptions, *sid, snapName, cr)
|
errDefer := undoSnapReservation(ctx, parentVolOptions, *sid, snapName, cr)
|
||||||
if errDefer != nil {
|
if errDefer != nil {
|
||||||
klog.Warningf(util.Log(ctx, "failed undoing reservation of snapshot: %s (%s)"),
|
util.WarningLog(ctx, "failed undoing reservation of snapshot: %s (%s)",
|
||||||
requestName, errDefer)
|
requestName, errDefer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -527,7 +526,7 @@ func (cs *ControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateS
|
|||||||
err = protectSnapshot(ctx, parentVolOptions, cr, volumeID(sid.FsSnapshotName), volumeID(vid.FsSubvolName))
|
err = protectSnapshot(ctx, parentVolOptions, cr, volumeID(sid.FsSnapshotName), volumeID(vid.FsSubvolName))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
protected = false
|
protected = false
|
||||||
klog.Warningf(util.Log(ctx, "failed to protect snapshot of snapshot: %s (%s)"),
|
util.WarningLog(ctx, "failed to protect snapshot of snapshot: %s (%s)",
|
||||||
sid.FsSnapshotName, err)
|
sid.FsSnapshotName, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -552,7 +551,7 @@ func (cs *ControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateS
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
errDefer := undoSnapReservation(ctx, parentVolOptions, *sID, snapName, cr)
|
errDefer := undoSnapReservation(ctx, parentVolOptions, *sID, snapName, cr)
|
||||||
if errDefer != nil {
|
if errDefer != nil {
|
||||||
klog.Warningf(util.Log(ctx, "failed undoing reservation of snapshot: %s (%s)"),
|
util.WarningLog(ctx, "failed undoing reservation of snapshot: %s (%s)",
|
||||||
requestName, errDefer)
|
requestName, errDefer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -661,7 +660,7 @@ func (cs *ControllerServer) DeleteSnapshot(ctx context.Context, req *csi.DeleteS
|
|||||||
// if error is ErrPoolNotFound, the pool is already deleted we dont
|
// if error is ErrPoolNotFound, the pool is already deleted we dont
|
||||||
// need to worry about deleting snapshot or omap data, return success
|
// need to worry about deleting snapshot or omap data, return success
|
||||||
if errors.Is(err, util.ErrPoolNotFound) {
|
if errors.Is(err, util.ErrPoolNotFound) {
|
||||||
klog.Warningf(util.Log(ctx, "failed to get backend snapshot for %s: %v"), snapshotID, err)
|
util.WarningLog(ctx, "failed to get backend snapshot for %s: %v", snapshotID, err)
|
||||||
return &csi.DeleteSnapshotResponse{}, nil
|
return &csi.DeleteSnapshotResponse{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user