Skip to content

Commit

Permalink
Remove device check as it's not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
gohilankit committed Sep 3, 2020
1 parent 892840f commit 597ed59
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions pkg/csi/service/node.go
Expand Up @@ -503,23 +503,14 @@ func (s *service) NodeGetVolumeStats(
*csi.NodeGetVolumeStatsResponse, error) {
ctx = logger.NewContextWithLogger(ctx)
log := logger.GetLogger(ctx)
log.Infof("NodeGetVolumeStats: called with args %+v", *req)
log.Debugf("NodeGetVolumeStats: called with args %+v", *req)

var err error
targetPath := req.GetVolumePath()
if targetPath == "" {
return nil, status.Errorf(codes.InvalidArgument, "received empty targetpath %q", targetPath)
}

dev, err := getDevFromMount(targetPath)
if err != nil {
return nil, status.Errorf(codes.Internal, "unable to retrieve device from target %q", targetPath)
}
if dev == nil {
return nil, status.Errorf(codes.Internal, "could not find device mounted on targetpath %v", targetPath)
}
//TODO Check that the matching device is a vSphere volume, and that the volID matches the mount point

volMetrics, err := getMetrics(targetPath)
if err != nil {
return nil, status.Error(codes.Internal, err.Error())
Expand Down

0 comments on commit 597ed59

Please sign in to comment.