Return error from NodeGetInfo

This PR checks if NodeGetInfo returns error. If so, it returns
the error. Without this change, it always returns no error (nil)
regardless of whether NodeGetInfo returns error.
pull/58/head
Xing Yang 2018-09-22 12:00:15 -07:00
parent 5e5f7e5389
commit 0a14086792
1 changed files with 4 additions and 0 deletions

View File

@ -95,6 +95,10 @@ func (c *csiDriverClient) NodeGetInfo(ctx context.Context) (
nodeClient := csipb.NewNodeClient(conn)
res, err := nodeClient.NodeGetInfo(ctx, &csipb.NodeGetInfoRequest{})
if err != nil {
return "", 0, nil, err
}
return res.GetNodeId(), res.GetMaxVolumesPerNode(), res.GetAccessibleTopology(), nil
}