From cc600dab76a60079de86fe11702dfe80d6cc6dd6 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Tue, 11 Aug 2020 16:50:31 +0530 Subject: [PATCH] cephfs: replace klog.Error with util.ErrorLog in CreateVolume replaced klog.Error with util.ErrorLog in createVolume function. Signed-off-by: Madhu Rajanna --- internal/cephfs/controllerserver.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/cephfs/controllerserver.go b/internal/cephfs/controllerserver.go index 5da889cd3..e91a41d91 100644 --- a/internal/cephfs/controllerserver.go +++ b/internal/cephfs/controllerserver.go @@ -130,7 +130,7 @@ func checkContentSource(ctx context.Context, req *csi.CreateVolumeRequest, cr *u // nolint:gocognit:gocyclo // TODO: reduce complexity func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error) { if err := cs.validateCreateVolumeRequest(req); err != nil { - klog.Errorf(util.Log(ctx, "CreateVolumeRequest validation failed: %v"), err) + util.ErrorLog(ctx, "CreateVolumeRequest validation failed: %v", err) return nil, err } @@ -140,7 +140,7 @@ func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol cr, err := util.NewAdminCredentials(secret) if err != nil { - klog.Errorf(util.Log(ctx, "failed to retrieve admin credentials: %v"), err) + util.ErrorLog(ctx, "failed to retrieve admin credentials: %v", err) return nil, status.Error(codes.InvalidArgument, err.Error()) } defer cr.DeleteCredentials() @@ -154,7 +154,7 @@ func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol volOptions, err := newVolumeOptions(ctx, requestName, req, secret) if err != nil { - klog.Errorf(util.Log(ctx, "validation and extraction of volume options failed: %v"), err) + util.ErrorLog(ctx, "validation and extraction of volume options failed: %v", err) return nil, status.Error(codes.InvalidArgument, err.Error()) } @@ -185,7 +185,7 @@ func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol err = resizeVolume(ctx, volOptions, cr, volumeID(vID.FsSubvolName), volOptions.Size) if err != nil { if purgeErr := purgeVolume(ctx, volumeID(vID.FsSubvolName), cr, volOptions, false); err != nil { - klog.Errorf(util.Log(ctx, "failed to delete volume %s: %v"), requestName, purgeErr) + util.ErrorLog(ctx, "failed to delete volume %s: %v", requestName, purgeErr) // All errors other than ErrVolumeNotFound should return an error back to the caller if !errors.Is(purgeErr, ErrVolumeNotFound) { return nil, status.Error(codes.Internal, purgeErr.Error()) @@ -196,7 +196,7 @@ func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol klog.Warningf(util.Log(ctx, "failed undoing reservation of volume: %s (%s)"), requestName, errUndo) } - klog.Errorf(util.Log(ctx, "failed to expand volume %s: %v"), volumeID(vID.FsSubvolName), err) + util.ErrorLog(ctx, "failed to expand volume %s: %v", volumeID(vID.FsSubvolName), err) return nil, status.Error(codes.Internal, err.Error()) } }