Skip to content

Commit

Permalink
fix(log): update error log message during NodeStage request (#157) (#158
Browse files Browse the repository at this point in the history
)

This commit updates the error message to show the node name
where the volume is already mounted

Signed-off-by: mittachaitu <[email protected]>
  • Loading branch information
sai chaithanya authored Jul 22, 2021
1 parent fe452d0 commit 7b9fab6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/driver/node_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,15 +359,15 @@ 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)
if err != nil && !k8serror.IsNotFound(err) {
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)
}
}

Expand Down

0 comments on commit 7b9fab6

Please sign in to comment.