Skip to content

Commit

Permalink
util: remove unimplemented methods
Browse files Browse the repository at this point in the history
As we are using UnimplementedControllerServer
we dont need to implement mock
methods.

Signed-off-by: Madhu Rajanna <[email protected]>
  • Loading branch information
Madhu-1 committed Oct 19, 2023
1 parent f96a993 commit 2e72e51
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 60 deletions.
50 changes: 1 addition & 49 deletions internal/csi-common/controllerserver-default.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,40 +28,8 @@ import (

// DefaultControllerServer points to default driver.
type DefaultControllerServer struct {
Driver *CSIDriver
csi.UnimplementedControllerServer
}

// ControllerPublishVolume publish volume on node.
func (cs *DefaultControllerServer) ControllerPublishVolume(
ctx context.Context,
req *csi.ControllerPublishVolumeRequest,
) (*csi.ControllerPublishVolumeResponse, error) {
return nil, status.Error(codes.Unimplemented, "")
}

// ControllerUnpublishVolume unpublish on node.
func (cs *DefaultControllerServer) ControllerUnpublishVolume(
ctx context.Context,
req *csi.ControllerUnpublishVolumeRequest,
) (*csi.ControllerUnpublishVolumeResponse, error) {
return nil, status.Error(codes.Unimplemented, "")
}

// ListVolumes lists volumes.
func (cs *DefaultControllerServer) ListVolumes(
ctx context.Context,
req *csi.ListVolumesRequest,
) (*csi.ListVolumesResponse, error) {
return nil, status.Error(codes.Unimplemented, "")
}

// GetCapacity get volume capacity.
func (cs *DefaultControllerServer) GetCapacity(
ctx context.Context,
req *csi.GetCapacityRequest,
) (*csi.GetCapacityResponse, error) {
return nil, status.Error(codes.Unimplemented, "")
Driver *CSIDriver
}

// ControllerGetCapabilities implements the default GRPC callout.
Expand All @@ -79,19 +47,3 @@ func (cs *DefaultControllerServer) ControllerGetCapabilities(
Capabilities: cs.Driver.capabilities,
}, nil
}

// ListSnapshots lists snapshots.
func (cs *DefaultControllerServer) ListSnapshots(
ctx context.Context,
req *csi.ListSnapshotsRequest,
) (*csi.ListSnapshotsResponse, error) {
return nil, status.Error(codes.Unimplemented, "")
}

// ControllerGetVolume fetch volume information.
func (cs *DefaultControllerServer) ControllerGetVolume(
ctx context.Context,
req *csi.ControllerGetVolumeRequest,
) (*csi.ControllerGetVolumeResponse, error) {
return nil, status.Error(codes.Unimplemented, "")
}
2 changes: 1 addition & 1 deletion internal/csi-common/identityserver-default.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (

// DefaultIdentityServer stores driver object.
type DefaultIdentityServer struct {
Driver *CSIDriver
csi.UnimplementedControllerServer
Driver *CSIDriver
}

// GetPluginInfo returns plugin information.
Expand Down
10 changes: 0 additions & 10 deletions internal/csi-common/nodeserver-default.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import (
"github.com/ceph/ceph-csi/internal/util/log"

"github.com/container-storage-interface/spec/lib/go/csi"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
mount "k8s.io/mount-utils"
)

Expand All @@ -35,14 +33,6 @@ type DefaultNodeServer struct {
Mounter mount.Interface
}

// NodeExpandVolume returns unimplemented response.
func (ns *DefaultNodeServer) NodeExpandVolume(
ctx context.Context,
req *csi.NodeExpandVolumeRequest,
) (*csi.NodeExpandVolumeResponse, error) {
return nil, status.Error(codes.Unimplemented, "")
}

// NodeGetInfo returns node ID.
func (ns *DefaultNodeServer) NodeGetInfo(
ctx context.Context,
Expand Down

0 comments on commit 2e72e51

Please sign in to comment.