From 65a10fd553beef3f8da63fed807d4283df0d2c1c Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 8 Dec 2020 14:25:06 +0100 Subject: [PATCH] cleanup: standardize error format in NodeServer.NodeStageVolume() Signed-off-by: Niels de Vos --- internal/rbd/nodeserver.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/rbd/nodeserver.go b/internal/rbd/nodeserver.go index a9499df95..0c69cf6e5 100644 --- a/internal/rbd/nodeserver.go +++ b/internal/rbd/nodeserver.go @@ -182,7 +182,7 @@ func (ns *NodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVol var imageAttributes *journal.ImageAttributes err = vi.DecomposeCSIID(volID) if err != nil { - err = fmt.Errorf("error decoding volume ID (%s) (%s)", err, volID) + err = fmt.Errorf("error decoding volume ID (%s): %w", volID, err) return nil, status.Error(codes.Internal, err.Error()) } @@ -196,7 +196,7 @@ func (ns *NodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVol imageAttributes, err = j.GetImageAttributes( ctx, volOptions.Pool, vi.ObjectUUID, false) if err != nil { - err = fmt.Errorf("error fetching image attributes for volume ID (%s) (%s)", err, volID) + err = fmt.Errorf("error fetching image attributes for volume ID (%s): %w", volID, err) return nil, status.Error(codes.Internal, err.Error()) } volOptions.RbdImageName = imageAttributes.ImageName