cleanup: gocyclo being unused for linter

This commit addresses the following issue:
'nolint:gocyclo // complexity needs to be reduced.'
is unused for linter "gocyclo" (nolintlint)

Updates:#2025

Signed-off-by: Yati Padia <ypadia@redhat.com>
This commit is contained in:
Yati Padia 2021-05-10 16:23:23 +05:30 committed by mergify[bot]
parent 5c079894c7
commit 6bfdf2feb0
4 changed files with 3 additions and 7 deletions

View File

@ -591,8 +591,7 @@ func checkContentSource(ctx context.Context, req *csi.CreateVolumeRequest, cr *u
// DeleteVolume deletes the volume in backend and removes the volume metadata // DeleteVolume deletes the volume in backend and removes the volume metadata
// from store // from store
// TODO: make this function less complex // TODO: make this function less complex.
// nolint:gocyclo // golangci-lint did not catch this earlier, needs to get fixed later
func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error) { func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error) {
if err := cs.Driver.ValidateControllerServiceRequest(csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME); err != nil { if err := cs.Driver.ValidateControllerServiceRequest(csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME); err != nil {
util.ErrorLog(ctx, "invalid delete volume req: %v", protosanitizer.StripSecrets(req)) util.ErrorLog(ctx, "invalid delete volume req: %v", protosanitizer.StripSecrets(req))

View File

@ -110,8 +110,7 @@ var (
// - Map the image (creates a device) // - Map the image (creates a device)
// - Create the staging file/directory under staging path // - Create the staging file/directory under staging path
// - Stage the device (mount the device mapped for image) // - Stage the device (mount the device mapped for image)
// TODO: make this function less complex // TODO: make this function less complex.
// nolint:gocyclo // complexity needs to be reduced.
func (ns *NodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error) { func (ns *NodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error) {
if err := util.ValidateNodeStageVolumeRequest(req); err != nil { if err := util.ValidateNodeStageVolumeRequest(req); err != nil {
return nil, err return nil, err

View File

@ -370,7 +370,6 @@ func (rs *ReplicationServer) DemoteVolume(ctx context.Context,
// ResyncVolume extracts the RBD volume information from the volumeID, If the // ResyncVolume extracts the RBD volume information from the volumeID, If the
// image is present, mirroring is enabled and the image is in demoted state. // image is present, mirroring is enabled and the image is in demoted state.
// If yes it will resync the image to correct the split-brain. // If yes it will resync the image to correct the split-brain.
// nolint:gocyclo // reduce complexity
// FIXME: reduce complexity. // FIXME: reduce complexity.
func (rs *ReplicationServer) ResyncVolume(ctx context.Context, func (rs *ReplicationServer) ResyncVolume(ctx context.Context,
req *replication.ResyncVolumeRequest, req *replication.ResyncVolumeRequest,

View File

@ -32,8 +32,7 @@ func cleanupTestData() {
os.RemoveAll(basePath) os.RemoveAll(basePath)
} }
// TODO: make this function less complex // TODO: make this function less complex.
// nolint:gocyclo // complexity needs to be reduced.
func TestCSIConfig(t *testing.T) { func TestCSIConfig(t *testing.T) {
var err error var err error
var data string var data string