From 7b9fab6722b2a4f7b7b6965f22b33e6be05a36bb Mon Sep 17 00:00:00 2001 From: sai chaithanya Date: Thu, 22 Jul 2021 13:09:43 +0530 Subject: [PATCH] fix(log): update error log message during NodeStage request (#157) (#158) This commit updates the error message to show the node name where the volume is already mounted Signed-off-by: mittachaitu --- pkg/driver/node_utils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/driver/node_utils.go b/pkg/driver/node_utils.go index 89df5ff2c..119c7b90b 100644 --- a/pkg/driver/node_utils.go +++ b/pkg/driver/node_utils.go @@ -359,7 +359,7 @@ func (ns *node) prepareVolumeForNode( oldNodeName := csiVol.GetLabels()["nodeID"] if oldNodeName == nodeID { - return errors.Errorf("Volume %s still mounted on node: %s", volumeID, nodeID) + return errors.Errorf("Volume %s still mounted on node: %s", volumeID, oldNodeName) } isNodeReady, err := k8snode.IsNodeReady(oldNodeName) @@ -367,7 +367,7 @@ func (ns *node) prepareVolumeForNode( logrus.Errorf("failed to get the node %s details error: %s", oldNodeName, err.Error()) return errors.Wrapf(err, "failed to get node %s details to know previous mounts", oldNodeName) } else if err == nil && isNodeReady { - return errors.Errorf("Volume %s still mounted on node %s", volumeID, nodeID) + return errors.Errorf("Volume %s still mounted on node %s", volumeID, oldNodeName) } }