From a681b2b2b6431a23ef45e1705b0adb85dca34f5b Mon Sep 17 00:00:00 2001 From: Serge Logvinov Date: Mon, 1 Jan 2024 14:47:20 +0200 Subject: [PATCH] fix: publish shared volumes Temporary fix, do not check existence pv on the node. Signed-off-by: Serge Logvinov --- pkg/csi/controller.go | 6 +++--- pkg/csi/controller_test.go | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pkg/csi/controller.go b/pkg/csi/controller.go index 2d82731..3454c4d 100644 --- a/pkg/csi/controller.go +++ b/pkg/csi/controller.go @@ -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", diff --git a/pkg/csi/controller_test.go b/pkg/csi/controller_test.go index a905ca4..bd1b168 100644 --- a/pkg/csi/controller_test.go +++ b/pkg/csi/controller_test.go @@ -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{