From 32d05a5b7fa981b56198a4eff388482322df93a1 Mon Sep 17 00:00:00 2001 From: David-T-White <64927637+David-T-White@users.noreply.github.com> Date: Thu, 1 Jun 2023 11:40:06 -0600 Subject: [PATCH] HS-306/invalid node return code (#86) * fix: Return error code 5 instead of 14 if nodeID specified in ControllerPublishVolume is invalid/unreachable --- pkg/controller/publisher.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/controller/publisher.go b/pkg/controller/publisher.go index bfd756b7..7a00d75a 100644 --- a/pkg/controller/publisher.go +++ b/pkg/controller/publisher.go @@ -2,6 +2,7 @@ package controller import ( "context" + "fmt" "github.com/Seagate/seagate-exos-x-csi/pkg/common" "github.com/Seagate/seagate-exos-x-csi/pkg/node_service" @@ -40,7 +41,7 @@ func (driver *Controller) ControllerPublishVolume(ctx context.Context, req *csi. initiators, err := node_service.GetNodeInitiators(nodeIP, reqType) if err != nil { klog.ErrorS(err, "error getting node initiators", "node-ip", nodeIP, "storage-protocol", reqType) - return nil, err + return nil, status.Error(codes.NotFound, fmt.Sprintf("Could not retrieve initiators for scheduled node(%s)", nodeIP)) } volumeName, _ := common.VolumeIdGetName(req.GetVolumeId())