diff options
| author | washcycle <litho23@gmail.com> | 2023-04-22 15:56:02 -0500 |
|---|---|---|
| committer | washcycle <litho23@gmail.com> | 2023-04-22 15:56:02 -0500 |
| commit | 8208f32f3f7047ed5f315523dcf89ba86329d0ee (patch) | |
| tree | ebfa63bf893086ce2f3571983fde68fc4432e7f2 /pkg/driver/controllerserver.go | |
| parent | 3b656266b0da5457668b002ae6146b5d0976e781 (diff) | |
| download | seaweedfs-csi-driver-8208f32f3f7047ed5f315523dcf89ba86329d0ee.tar.xz seaweedfs-csi-driver-8208f32f3f7047ed5f315523dcf89ba86329d0ee.zip | |
-fixed several csi sanity tests
-removed deprecated/unneeded passthrough import
-added test.sh (needs work)
Diffstat (limited to 'pkg/driver/controllerserver.go')
| -rw-r--r-- | pkg/driver/controllerserver.go | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/pkg/driver/controllerserver.go b/pkg/driver/controllerserver.go index 0533f07..b032542 100644 --- a/pkg/driver/controllerserver.go +++ b/pkg/driver/controllerserver.go @@ -13,7 +13,6 @@ import ( "github.com/seaweedfs/seaweedfs/weed/glog" "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" "google.golang.org/grpc/codes" - _ "google.golang.org/grpc/resolver/passthrough" "google.golang.org/grpc/status" ) @@ -71,7 +70,7 @@ func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVol volumeId := req.VolumeId // Check arguments - if volumeId == "" { + if len(volumeId) == 0 { return nil, status.Error(codes.InvalidArgument, "Volume ID missing in request") } @@ -89,10 +88,34 @@ func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVol } func (cs *ControllerServer) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error) { + + // Check arguments + volumeId := req.VolumeId + if len(volumeId) == 0 { + return nil, status.Error(codes.InvalidArgument, "Volume ID missing in request") + } + + volumePath := req.GetVolumeContext()["volumePath"] + if len(volumePath) == 0 { + return nil, status.Error(codes.InvalidArgument, "Volume path missing in request") + } + + nodeId := req.NodeId + if len(nodeId) == 0 { + return nil, status.Error(codes.InvalidArgument, "Node ID missing in request") + } + return &csi.ControllerPublishVolumeResponse{}, nil } func (cs *ControllerServer) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error) { + + // Check arguments + volumeId := req.VolumeId + if len(volumeId) == 0 { + return nil, status.Error(codes.InvalidArgument, "Volume ID missing in request") + } + return &csi.ControllerUnpublishVolumeResponse{}, nil } |
