Skip to content

Commit

Permalink
Demo CR DO NOT MERGE
Browse files Browse the repository at this point in the history
  • Loading branch information
ElijahQuinones committed Jan 9, 2025
1 parent c344ffc commit b1d07ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pkg/driver/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func (d *NodeService) NodeStageVolume(ctx context.Context, req *csi.NodeStageVol

source, err := d.mounter.FindDevicePath(devicePath, volumeID, partition, d.metadata.GetRegion())
if err != nil {
return nil, status.Errorf(codes.NotFound, "Failed to find device path %s. %v", devicePath, err)
return nil, status.Errorf(codes.Internal, "Failed to find device path %s. %v", devicePath, err)
}

klog.V(4).InfoS("NodeStageVolume: find device path", "devicePath", devicePath, "source", source)
Expand Down Expand Up @@ -394,7 +394,7 @@ func (d *NodeService) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandV

devicePath, err := d.mounter.FindDevicePath(deviceName, volumeID, "", d.metadata.GetRegion())
if err != nil {
return nil, status.Errorf(codes.NotFound, "failed to find device path for device name %s for mount %s: %v", deviceName, req.GetVolumePath(), err)
return nil, status.Errorf(codes.Internal, "failed to find device path for device name %s for mount %s: %v", deviceName, req.GetVolumePath(), err)
}

// TODO: lock per volume ID to have some idempotency
Expand Down Expand Up @@ -625,7 +625,7 @@ func (d *NodeService) nodePublishVolumeForBlock(req *csi.NodePublishVolumeReques

source, err := d.mounter.FindDevicePath(devicePath, volumeID, partition, d.metadata.GetRegion())
if err != nil {
return status.Errorf(codes.NotFound, "Failed to find device path %s. %v", devicePath, err)
return status.Errorf(codes.Internal, "Failed to find device path %s. %v", devicePath, err)
}

klog.V(4).InfoS("NodePublishVolume [block]: find device path", "devicePath", devicePath, "source", source)
Expand Down
6 changes: 3 additions & 3 deletions pkg/driver/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ func TestNodeStageVolume(t *testing.T) {
m.EXPECT().GetRegion().Return("us-west-2")
return m
},
expectedErr: status.Errorf(codes.NotFound, "Failed to find device path %s. %v", "/dev/xvdba", errors.New("find device path error")),
expectedErr: status.Errorf(codes.Internal, "Failed to find device path %s. %v", "/dev/xvdba", errors.New("find device path error")),
},
{
name: "path_exists_error",
Expand Down Expand Up @@ -1743,7 +1743,7 @@ func TestNodePublishVolume(t *testing.T) {
m.EXPECT().GetRegion().Return("us-west-2")
return m
},
expectedErr: status.Error(codes.NotFound, "Failed to find device path /dev/xvdba. device path error"),
expectedErr: status.Error(codes.Internal, "Failed to find device path /dev/xvdba. device path error"),
},
}
for _, tc := range testCases {
Expand Down Expand Up @@ -2271,7 +2271,7 @@ func TestNodeExpandVolume(t *testing.T) {
return m
},
expectedResp: nil,
expectedErr: status.Error(codes.NotFound, "failed to find device path for device name device-name for mount /volume/path: failed to find device path"),
expectedErr: status.Error(codes.Internal, "failed to find device path for device name device-name for mount /volume/path: failed to find device path"),
},
{
name: "resize_error",
Expand Down

0 comments on commit b1d07ff

Please sign in to comment.