From 70358c8eb7c864609574f409cad1025947120490 Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Mon, 19 Oct 2020 18:38:07 +0530 Subject: [PATCH] rbd: volJournal.Connect() return wrongly pushed to caller volJournal.Connect() got the error on err2 variable, however the return was on variable err which hold the error return of DecomposeCSIID() which is wrong. This cause the error return wrongly parsed and pushed from the caller. From now on, we are reusing the err variable to hold and revert the error of volJournal.Connect(). Signed-off-by: Humble Chirammal --- internal/rbd/nodeserver.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/rbd/nodeserver.go b/internal/rbd/nodeserver.go index 2df6a5852..a9499df95 100644 --- a/internal/rbd/nodeserver.go +++ b/internal/rbd/nodeserver.go @@ -186,10 +186,10 @@ func (ns *NodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVol return nil, status.Error(codes.Internal, err.Error()) } - j, err2 := volJournal.Connect(volOptions.Monitors, volOptions.RadosNamespace, cr) - if err2 != nil { - util.ErrorLog(ctx, "failed to establish cluster connection: %v", err2) - return nil, status.Error(codes.Internal, err.Error()) + j, connErr := volJournal.Connect(volOptions.Monitors, volOptions.RadosNamespace, cr) + if connErr != nil { + util.ErrorLog(ctx, "failed to establish cluster connection: %v", connErr) + return nil, status.Error(codes.Internal, connErr.Error()) } defer j.Destroy()