Skip to content

Commit

Permalink
chore: enable unused-parameter from revive
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu MOREL <[email protected]>
  • Loading branch information
mmorel-35 committed Jan 17, 2025
1 parent 5b1738a commit 1edf3b7
Show file tree
Hide file tree
Showing 151 changed files with 489 additions and 490 deletions.
1 change: 0 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ linters-settings:
- name: unreachable-code
disabled: false
- name: unused-parameter
disabled: true
- name: use-any
disabled: true
- name: var-declaration
Expand Down
12 changes: 6 additions & 6 deletions internal/hook/item_hook_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,12 @@ func (h *DefaultItemHookHandler) HandleHooks(
type NoOpItemHookHandler struct{}

func (h *NoOpItemHookHandler) HandleHooks(
log logrus.FieldLogger,
groupResource schema.GroupResource,
obj runtime.Unstructured,
resourceHooks []ResourceHook,
phase HookPhase,
hookTracker *HookTracker,
_ logrus.FieldLogger,
_ schema.GroupResource,
_ runtime.Unstructured,
_ []ResourceHook,
_ HookPhase,
_ *HookTracker,
) error {
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion internal/hook/wait_exec_hook_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (e *DefaultWaitExecHookHandler) HandleHooks(
UpdateFunc: func(_, newObj interface{}) {
handler(newObj)
},
DeleteFunc: func(obj interface{}) {
DeleteFunc: func(_ interface{}) {
err := fmt.Errorf("pod %s deleted before all hooks were executed", kube.NamespaceAndName(pod))
log.Error(err)
cancel()
Expand Down
2 changes: 1 addition & 1 deletion internal/hook/wait_exec_hook_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type fakeListWatchFactory struct {
lw cache.ListerWatcher
}

func (f *fakeListWatchFactory) NewListWatch(ns string, selector fields.Selector) cache.ListerWatcher {
func (f *fakeListWatchFactory) NewListWatch(_ string, _ fields.Selector) cache.ListerWatcher {
return f.lw
}

Expand Down
2 changes: 1 addition & 1 deletion internal/storage/storagelocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func ListBackupStorageLocations(ctx context.Context, kbClient client.Client, nam
return locations, nil
}

func GetDefaultBackupStorageLocations(ctx context.Context, kbClient client.Client, namespace string) (*velerov1api.BackupStorageLocationList, error) {
func GetDefaultBackupStorageLocations(_ context.Context, kbClient client.Client, namespace string) (*velerov1api.BackupStorageLocationList, error) {
locations := new(velerov1api.BackupStorageLocationList)
defaultLocations := new(velerov1api.BackupStorageLocationList)
if err := kbClient.List(context.Background(), locations, &client.ListOptions{Namespace: namespace}); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/backup/actions/backup_pv_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (a *PVCAction) AppliesTo() (velero.ResourceSelector, error) {

// Execute finds the PersistentVolume bound by the provided
// PersistentVolumeClaim, if any, and backs it up
func (a *PVCAction) Execute(item runtime.Unstructured, backup *v1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error) {
func (a *PVCAction) Execute(item runtime.Unstructured, _ *v1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error) {
a.log.Info("Executing PVCAction")

pvc := new(corev1api.PersistentVolumeClaim)
Expand Down
6 changes: 3 additions & 3 deletions pkg/backup/actions/csi/volumesnapshot_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func (p *volumeSnapshotBackupItemAction) Name() string {

func (p *volumeSnapshotBackupItemAction) Progress(
operationID string,
backup *velerov1api.Backup,
_ *velerov1api.Backup,
) (velero.OperationProgress, error) {
progress := velero.OperationProgress{}
if operationID == "" {
Expand Down Expand Up @@ -360,8 +360,8 @@ func (p *volumeSnapshotBackupItemAction) Progress(

// Cancel is not implemented for VolumeSnapshotBackupItemAction
func (p *volumeSnapshotBackupItemAction) Cancel(
operationID string,
backup *velerov1api.Backup,
_ string,
_ *velerov1api.Backup,
) error {
// CSI Specification doesn't support canceling a snapshot creation.
return nil
Expand Down
10 changes: 5 additions & 5 deletions pkg/backup/actions/csi/volumesnapshotclass_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (p *volumeSnapshotClassBackupItemAction) AppliesTo() (
// items any snapshot lister secret that may be referenced in its annotations.
func (p *volumeSnapshotClassBackupItemAction) Execute(
item runtime.Unstructured,
backup *velerov1api.Backup,
_ *velerov1api.Backup,
) (
runtime.Unstructured,
[]velero.ResourceIdentifier,
Expand Down Expand Up @@ -103,16 +103,16 @@ func (p *volumeSnapshotClassBackupItemAction) Name() string {

// Progress is not implemented for VolumeSnapshotClassBackupItemAction
func (p *volumeSnapshotClassBackupItemAction) Progress(
operationID string,
backup *velerov1api.Backup,
_ string,
_ *velerov1api.Backup,
) (velero.OperationProgress, error) {
return velero.OperationProgress{}, nil
}

// Cancel is not implemented for VolumeSnapshotClassBackupItemAction
func (p *volumeSnapshotClassBackupItemAction) Cancel(
operationID string,
backup *velerov1api.Backup,
_ string,
_ *velerov1api.Backup,
) error {
return nil
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/backup/actions/csi/volumesnapshotcontent_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,16 @@ func (p *volumeSnapshotContentBackupItemAction) Name() string {

// Progress is not implemented for VolumeSnapshotContentBackupItemAction.
func (p *volumeSnapshotContentBackupItemAction) Progress(
operationID string,
backup *velerov1api.Backup,
_ string,
_ *velerov1api.Backup,
) (velero.OperationProgress, error) {
return velero.OperationProgress{}, nil
}

// Cancel is not implemented for VolumeSnapshotContentBackupItemAction.
func (p *volumeSnapshotContentBackupItemAction) Cancel(
operationID string,
backup *velerov1api.Backup,
_ string,
_ *velerov1api.Backup,
) error {
// CSI Specification doesn't support canceling a snapshot creation.
return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/backup/actions/pod_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (a *PodAction) AppliesTo() (velero.ResourceSelector, error) {
// Execute scans the pod's spec.volumes for persistentVolumeClaim volumes and returns a
// ResourceIdentifier list containing references to all of the persistentVolumeClaim volumes used by
// the pod. This ensures that when a pod is backed up, all referenced PVCs are backed up too.
func (a *PodAction) Execute(item runtime.Unstructured, backup *v1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error) {
func (a *PodAction) Execute(item runtime.Unstructured, _ *v1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error) {
a.log.Info("Executing podAction")
defer a.log.Info("Done executing podAction")

Expand Down
2 changes: 1 addition & 1 deletion pkg/backup/actions/remap_crd_version_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (a *RemapCRDVersionAction) AppliesTo() (velero.ResourceSelector, error) {
}

// Execute executes logic necessary to check a CustomResourceDefinition and inspect it for characteristics that necessitate saving it as v1beta1 instead of v1.
func (a *RemapCRDVersionAction) Execute(item runtime.Unstructured, backup *v1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error) {
func (a *RemapCRDVersionAction) Execute(item runtime.Unstructured, _ *v1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error) {
a.logger.Info("Executing RemapCRDVersionAction")

// This plugin is only relevant for CRDs retrieved from the v1 endpoint that were installed via the v1beta1
Expand Down
2 changes: 1 addition & 1 deletion pkg/backup/actions/service_account_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (a *ServiceAccountAction) AppliesTo() (velero.ResourceSelector, error) {
// Execute checks for any ClusterRoleBindings that have this service account as a subject, and
// adds the ClusterRoleBinding and associated ClusterRole to the list of additional items to
// be backed up.
func (a *ServiceAccountAction) Execute(item runtime.Unstructured, backup *v1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error) {
func (a *ServiceAccountAction) Execute(item runtime.Unstructured, _ *v1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error) {
a.log.Info("Running ServiceAccountAction")
defer a.log.Info("Done running ServiceAccountAction")

Expand Down
Loading

0 comments on commit 1edf3b7

Please sign in to comment.