Skip to content

Commit

Permalink
fix: publish shared volumes
Browse files Browse the repository at this point in the history
Temporary fix, do not check existence pv on the node.

Signed-off-by: Serge Logvinov <[email protected]>
  • Loading branch information
sergelogvinov committed Jan 1, 2024
1 parent 2a86bd7 commit a681b2b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions pkg/csi/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,9 @@ func (d *ControllerService) ControllerPublishVolume(_ context.Context, request *
return nil, status.Error(codes.Internal, err.Error())
}

if vm.Node() != vol.Node() {
return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("volume %s does not exist on the node %s", volumeID, nodeID))
}
// if vm.Node() != vol.Node() {
// return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("volume %s does not exist on the node %s", volumeID, nodeID))
// }

options := map[string]string{
"backup": "0",
Expand Down
22 changes: 11 additions & 11 deletions pkg/csi/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -813,17 +813,17 @@ func (ts *csiTestSuite) TestControllerPublishVolumeError() {
},
expectedError: status.Error(codes.Internal, "proxmox cluster fake-region not found"),
},
{
msg: "WrongNode",
request: &proto.ControllerPublishVolumeRequest{
NodeId: "cluster-1-node-2",
VolumeId: "cluster-1/pve-1/local-lvm/vm-9999-pvc-123",
VolumeCapability: volcap,
VolumeContext: volCtx,
Readonly: true,
},
expectedError: status.Error(codes.InvalidArgument, "volume cluster-1/pve-1/local-lvm/vm-9999-pvc-123 does not exist on the node cluster-1-node-2"),
},
// {
// msg: "WrongNode",
// request: &proto.ControllerPublishVolumeRequest{
// NodeId: "cluster-1-node-2",
// VolumeId: "cluster-1/pve-1/local-lvm/vm-9999-pvc-123",
// VolumeCapability: volcap,
// VolumeContext: volCtx,
// Readonly: true,
// },
// expectedError: status.Error(codes.InvalidArgument, "volume cluster-1/pve-1/local-lvm/vm-9999-pvc-123 does not exist on the node cluster-1-node-2"),
// },
{
msg: "VolumeNotExist",
request: &proto.ControllerPublishVolumeRequest{
Expand Down

0 comments on commit a681b2b

Please sign in to comment.