util: use local ErrorLog() for Create/RemoveObject() instead of klog

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2020-08-07 10:21:20 +02:00 committed by mergify[bot]
parent eaea18df0f
commit b864afd6d7

View File

@ -24,7 +24,6 @@ import (
"os/exec" "os/exec"
"github.com/ceph/go-ceph/rados" "github.com/ceph/go-ceph/rados"
klog "k8s.io/klog/v2"
) )
// InvalidPoolID used to denote an invalid pool. // InvalidPoolID used to denote an invalid pool.
@ -147,7 +146,7 @@ func CreateObject(ctx context.Context, monitors string, cr *Credentials, poolNam
if errors.Is(err, rados.ErrObjectExists) { if errors.Is(err, rados.ErrObjectExists) {
return JoinErrors(ErrObjectExists, err) return JoinErrors(ErrObjectExists, err)
} else if err != nil { } else if err != nil {
klog.Errorf(Log(ctx, "failed creating omap (%s) in pool (%s): (%v)"), objectName, poolName, err) ErrorLog(Log(ctx, "failed creating omap (%s) in pool (%s): (%v)"), objectName, poolName, err)
return err return err
} }
@ -181,7 +180,7 @@ func RemoveObject(ctx context.Context, monitors string, cr *Credentials, poolNam
if errors.Is(err, rados.ErrNotFound) { if errors.Is(err, rados.ErrNotFound) {
return JoinErrors(ErrObjectNotFound, err) return JoinErrors(ErrObjectNotFound, err)
} else if err != nil { } else if err != nil {
klog.Errorf(Log(ctx, "failed removing omap (%s) in pool (%s): (%v)"), oMapName, poolName, err) ErrorLog(Log(ctx, "failed removing omap (%s) in pool (%s): (%v)"), oMapName, poolName, err)
return err return err
} }