From a7a928d7ec377b400f8e954a48b7f4d1c4603902 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 8 Dec 2020 14:20:22 +0100 Subject: [PATCH] cleanup: return error from execCommandErr() in bindMount() Signed-off-by: Niels de Vos --- internal/cephfs/volumemounter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/cephfs/volumemounter.go b/internal/cephfs/volumemounter.go index 67bd6eb89..19f6f0463 100644 --- a/internal/cephfs/volumemounter.go +++ b/internal/cephfs/volumemounter.go @@ -243,13 +243,13 @@ func (m *kernelMounter) name() string { return "Ceph kernel client" } func bindMount(ctx context.Context, from, to string, readOnly bool, mntOptions []string) error { mntOptionSli := strings.Join(mntOptions, ",") if err := execCommandErr(ctx, "mount", "-o", mntOptionSli, from, to); err != nil { - return fmt.Errorf("failed to bind-mount %s to %s: %v", from, to, err) + return fmt.Errorf("failed to bind-mount %s to %s: %w", from, to, err) } if readOnly { mntOptionSli = util.MountOptionsAdd(mntOptionSli, "remount") if err := execCommandErr(ctx, "mount", "-o", mntOptionSli, to); err != nil { - return fmt.Errorf("failed read-only remount of %s: %v", to, err) + return fmt.Errorf("failed read-only remount of %s: %w", to, err) } }