Skip to content

Commit

Permalink
fix errors from make verify
Browse files Browse the repository at this point in the history
  • Loading branch information
ElijahQuinones committed Jul 22, 2024
1 parent f9275ba commit f669ab8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
18 changes: 9 additions & 9 deletions pkg/driver/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ func validateControllerUnpublishVolumeRequest(req *csi.ControllerUnpublishVolume
}

func (d *ControllerService) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error) {
klog.V(4).InfoS("ControllerGetCapabilities: called", "args", *req)
klog.V(4).InfoS("ControllerGetCapabilities: called", "args", req)
var caps []*csi.ControllerServiceCapability
for _, cap := range controllerCaps {
c := &csi.ControllerServiceCapability{
Expand All @@ -504,17 +504,17 @@ func (d *ControllerService) ControllerGetCapabilities(ctx context.Context, req *
}

func (d *ControllerService) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error) {
klog.V(4).InfoS("GetCapacity: called", "args", *req)
klog.V(4).InfoS("GetCapacity: called", "args", req)
return nil, status.Error(codes.Unimplemented, "")
}

func (d *ControllerService) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error) {
klog.V(4).InfoS("ListVolumes: called", "args", *req)
klog.V(4).InfoS("ListVolumes: called", "args", req)
return nil, status.Error(codes.Unimplemented, "")
}

func (d *ControllerService) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error) {
klog.V(4).InfoS("ValidateVolumeCapabilities: called", "args", *req)
klog.V(4).InfoS("ValidateVolumeCapabilities: called", "args", req)
volumeID := req.GetVolumeId()
if len(volumeID) == 0 {
return nil, status.Error(codes.InvalidArgument, "Volume ID not provided")
Expand Down Expand Up @@ -604,7 +604,7 @@ func (d *ControllerService) ControllerModifyVolume(ctx context.Context, req *csi
}

func (d *ControllerService) ControllerGetVolume(ctx context.Context, req *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error) {
klog.V(4).InfoS("ControllerGetVolume: called", "args", *req)
klog.V(4).InfoS("ControllerGetVolume: called", "args", req)
return nil, status.Error(codes.Unimplemented, "")
}

Expand Down Expand Up @@ -687,7 +687,7 @@ func (d *ControllerService) CreateSnapshot(ctx context.Context, req *csi.CreateS
return nil, status.Errorf(codes.AlreadyExists, "Snapshot %s already exists for different volume (%s)", snapshotName, snapshot.SourceVolumeID)
}
klog.V(4).InfoS("Snapshot of volume already exists; nothing to do", "snapshotName", snapshotName, "volumeId", volumeID)
return newCreateSnapshotResponse(snapshot)
return newCreateSnapshotResponse(snapshot), nil
}

snapshotTags := map[string]string{
Expand Down Expand Up @@ -776,7 +776,7 @@ func (d *ControllerService) CreateSnapshot(ctx context.Context, req *csi.CreateS
return nil, status.Errorf(codes.Internal, "Failed to create Fast Snapshot Restores for snapshot ID %q: %v", snapshotName, err)
}
}
return newCreateSnapshotResponse(snapshot)
return newCreateSnapshotResponse(snapshot), nil
}

func validateCreateSnapshotRequest(req *csi.CreateSnapshotRequest) error {
Expand Down Expand Up @@ -952,7 +952,7 @@ func newCreateVolumeResponse(disk *cloud.Disk, ctx map[string]string) *csi.Creat
}
}

func newCreateSnapshotResponse(snapshot *cloud.Snapshot) (*csi.CreateSnapshotResponse, error) {
func newCreateSnapshotResponse(snapshot *cloud.Snapshot) *csi.CreateSnapshotResponse {
ts := timestamppb.New(snapshot.CreationTime)

return &csi.CreateSnapshotResponse{
Expand All @@ -963,7 +963,7 @@ func newCreateSnapshotResponse(snapshot *cloud.Snapshot) (*csi.CreateSnapshotRes
CreationTime: ts,
ReadyToUse: snapshot.ReadyToUse,
},
}, nil
}
}

func newListSnapshotsResponse(cloudResponse *cloud.ListSnapshotsResponse) *csi.ListSnapshotsResponse {
Expand Down
6 changes: 3 additions & 3 deletions pkg/driver/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
)

func (d *Driver) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error) {
klog.V(6).InfoS("GetPluginInfo: called", "args", *req)
klog.V(6).InfoS("GetPluginInfo: called", "args", req)
resp := &csi.GetPluginInfoResponse{
Name: DriverName,
VendorVersion: driverVersion,
Expand All @@ -34,7 +34,7 @@ func (d *Driver) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoReques
}

func (d *Driver) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error) {
klog.V(6).InfoS("GetPluginCapabilities: called", "args", *req)
klog.V(6).InfoS("GetPluginCapabilities: called", "args", req)
resp := &csi.GetPluginCapabilitiesResponse{
Capabilities: []*csi.PluginCapability{
{
Expand All @@ -58,6 +58,6 @@ func (d *Driver) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCa
}

func (d *Driver) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error) {
klog.V(6).InfoS("Probe: called", "args", *req)
klog.V(6).InfoS("Probe: called", "args", req)
return &csi.ProbeResponse{}, nil
}
8 changes: 4 additions & 4 deletions pkg/driver/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func (d *NodeService) NodeStageVolume(ctx context.Context, req *csi.NodeStageVol
}

func (d *NodeService) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error) {
klog.V(4).InfoS("NodeUnstageVolume: called", "args", *req)
klog.V(4).InfoS("NodeUnstageVolume: called", "args", req)
volumeID := req.GetVolumeId()
if len(volumeID) == 0 {
return nil, status.Error(codes.InvalidArgument, "Volume ID not provided")
Expand Down Expand Up @@ -493,7 +493,7 @@ func (d *NodeService) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpu
}

func (d *NodeService) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error) {
klog.V(4).InfoS("NodeGetVolumeStats: called", "args", *req)
klog.V(4).InfoS("NodeGetVolumeStats: called", "args", req)
if len(req.GetVolumeId()) == 0 {
return nil, status.Error(codes.InvalidArgument, "NodeGetVolumeStats volume ID was empty")
}
Expand Down Expand Up @@ -556,7 +556,7 @@ func (d *NodeService) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVo
}

func (d *NodeService) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error) {
klog.V(4).InfoS("NodeGetCapabilities: called", "args", *req)
klog.V(4).InfoS("NodeGetCapabilities: called", "args", req)
var caps []*csi.NodeServiceCapability
for _, cap := range nodeCaps {
c := &csi.NodeServiceCapability{
Expand All @@ -572,7 +572,7 @@ func (d *NodeService) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetC
}

func (d *NodeService) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) {
klog.V(4).InfoS("NodeGetInfo: called", "args", *req)
klog.V(4).InfoS("NodeGetInfo: called", "args", req)

zone := d.metadata.GetAvailabilityZone()
osType := runtime.GOOS
Expand Down
2 changes: 1 addition & 1 deletion pkg/driver/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2003,7 +2003,7 @@ func TestNodeExpandVolume(t *testing.T) {
},
},
},
expectedErr: status.Error(codes.InvalidArgument, "VolumeCapability is invalid: block:{} access_mode:{}"),
expectedErr: status.Error(codes.InvalidArgument, "VolumeCapability is invalid: block:{} access_mode:{}"),
},
{
name: "block_device",
Expand Down

0 comments on commit f669ab8

Please sign in to comment.