Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
falfaroc committed Dec 19, 2024
1 parent 160dbc4 commit 23a138e
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions service/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,15 @@ func (s *service) NodeGetInfo(
}
}

nodeID, err := GetNodeUID(ctx, s)
if err != nil {
return nil, status.Error(codes.InvalidArgument, GetMessage("Could not fetch node UID"))
}

if s.opts.SdcGUID != "" {
nodeID = s.opts.SdcGUID
}

for _, array := range s.opts.arrays {
isNFS, err := s.checkNFS(ctx, array.SystemID)
if err != nil {
Expand All @@ -786,26 +795,15 @@ func (s *service) NodeGetInfo(
if zone, ok := topology[s.opts.zoneLabelKey]; ok {
if zone == string(array.AvailabilityZone.Name) {
// Add only the secret values with the correct zone.
nodeID, _ := GetNodeUID(ctx, s)
Log.Infof("Zone found for node ID: %s, adding system ID: %s to node topology", nodeID, array.SystemID)
topology[Name+"/"+array.SystemID] = SystemTopologySystemValue
}
} else {
nodeID, _ := GetNodeUID(ctx, s)
Log.Infof("No zoning found for node ID: %s, adding system ID: %s", nodeID, array.SystemID)
topology[Name+"/"+array.SystemID] = SystemTopologySystemValue
}
}

nodeID, err := GetNodeUID(ctx, s)
if err != nil {
return nil, status.Error(codes.InvalidArgument, GetMessage("Could not fetch node UID"))
}

if s.opts.SdcGUID != "" {
nodeID = s.opts.SdcGUID
}

Log.Debugf("NodeId: %v\n", nodeID)
return &csi.NodeGetInfoResponse{
NodeId: nodeID,
Expand Down

0 comments on commit 23a138e

Please sign in to comment.