Skip to content

Commit

Permalink
HS-306/invalid node return code (#86)
Browse files Browse the repository at this point in the history
* fix: Return error code 5 instead of 14 if nodeID specified in ControllerPublishVolume is invalid/unreachable
  • Loading branch information
David-T-White committed Jun 1, 2023
1 parent 2b44525 commit 32d05a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/controller/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit 32d05a5

Please sign in to comment.