cephfs: replace Errorf with ErrorLog in purgeVolume

replace Errorf with ErrorLog in purgeVolume
for context based logging

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2020-08-11 17:57:18 +05:30 committed by mergify[bot]
parent 5a1652e5e8
commit fbe090065d

View File

@ -23,8 +23,6 @@ import (
"strings" "strings"
"github.com/ceph/ceph-csi/internal/util" "github.com/ceph/ceph-csi/internal/util"
klog "k8s.io/klog/v2"
) )
var ( var (
@ -253,7 +251,7 @@ func purgeVolume(ctx context.Context, volID volumeID, cr *util.Credentials, volO
err := execCommandErr(ctx, "ceph", arg...) err := execCommandErr(ctx, "ceph", arg...)
if err != nil { if err != nil {
klog.Errorf(util.Log(ctx, "failed to purge subvolume %s(%s) in fs %s"), string(volID), err, volOptions.FsName) util.ErrorLog(ctx, "failed to purge subvolume %s(%s) in fs %s", string(volID), err, volOptions.FsName)
if strings.HasPrefix(err.Error(), ErrVolumeNotFound.Error()) { if strings.HasPrefix(err.Error(), ErrVolumeNotFound.Error()) {
return util.JoinErrors(ErrVolumeNotFound, err) return util.JoinErrors(ErrVolumeNotFound, err)
} }