From 0a140867920a92e226b6ec0c7d698c850a9fe212 Mon Sep 17 00:00:00 2001 From: Xing Yang Date: Sat, 22 Sep 2018 12:00:15 -0700 Subject: [PATCH] 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. --- pkg/volume/csi/csi_client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/volume/csi/csi_client.go b/pkg/volume/csi/csi_client.go index 4a4cb4176b..36055db9aa 100644 --- a/pkg/volume/csi/csi_client.go +++ b/pkg/volume/csi/csi_client.go @@ -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 }