mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-04 15:16:58 +00:00
chore: enable use-any from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
@@ -548,7 +548,7 @@ func getBackupRepositoryConfig(ctx context.Context, ctrlClient client.Client, co
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
var unmarshalled map[string]interface{}
|
||||
var unmarshalled map[string]any
|
||||
if err := json.Unmarshal([]byte(jsonData), &unmarshalled); err != nil {
|
||||
return nil, errors.Wrapf(err, "error unmarshalling config data from %s for repo %s, repo type %s", configName, repoName, repoType)
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ import (
|
||||
|
||||
const testMaintenanceFrequency = 10 * time.Minute
|
||||
|
||||
func mockBackupRepoReconciler(t *testing.T, mockOn string, arg interface{}, ret ...interface{}) *BackupRepoReconciler {
|
||||
func mockBackupRepoReconciler(t *testing.T, mockOn string, arg any, ret ...any) *BackupRepoReconciler {
|
||||
t.Helper()
|
||||
mgr := &repomokes.Manager{}
|
||||
if mockOn != "" {
|
||||
|
||||
@@ -796,7 +796,7 @@ func (r *DataUploadReconciler) closeDataPath(ctx context.Context, duName string)
|
||||
r.dataPathMgr.RemoveAsyncBR(duName)
|
||||
}
|
||||
|
||||
func (r *DataUploadReconciler) setupExposeParam(du *velerov2alpha1api.DataUpload) (interface{}, error) {
|
||||
func (r *DataUploadReconciler) setupExposeParam(du *velerov2alpha1api.DataUpload) (any, error) {
|
||||
log := r.logger.WithField("dataupload", du.Name)
|
||||
|
||||
if du.Spec.SnapshotType == velerov2alpha1api.SnapshotTypeCSI {
|
||||
@@ -854,7 +854,7 @@ func (r *DataUploadReconciler) setupExposeParam(du *velerov2alpha1api.DataUpload
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (r *DataUploadReconciler) setupWaitExposePara(du *velerov2alpha1api.DataUpload) interface{} {
|
||||
func (r *DataUploadReconciler) setupWaitExposePara(du *velerov2alpha1api.DataUpload) any {
|
||||
if du.Spec.SnapshotType == velerov2alpha1api.SnapshotTypeCSI {
|
||||
return &exposer.CSISnapshotExposeWaitParam{
|
||||
NodeClient: r.client,
|
||||
|
||||
@@ -272,7 +272,7 @@ type fakeSnapshotExposer struct {
|
||||
peekErr error
|
||||
}
|
||||
|
||||
func (f *fakeSnapshotExposer) Expose(ctx context.Context, ownerObject corev1.ObjectReference, param interface{}) error {
|
||||
func (f *fakeSnapshotExposer) Expose(ctx context.Context, ownerObject corev1.ObjectReference, param any) error {
|
||||
du := velerov2alpha1api.DataUpload{}
|
||||
err := f.kubeClient.Get(ctx, kbclient.ObjectKey{
|
||||
Name: dataUploadName,
|
||||
@@ -289,7 +289,7 @@ func (f *fakeSnapshotExposer) Expose(ctx context.Context, ownerObject corev1.Obj
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f *fakeSnapshotExposer) GetExposed(ctx context.Context, du corev1.ObjectReference, tm time.Duration, para interface{}) (*exposer.ExposeResult, error) {
|
||||
func (f *fakeSnapshotExposer) GetExposed(ctx context.Context, du corev1.ObjectReference, tm time.Duration, para any) (*exposer.ExposeResult, error) {
|
||||
pod := &corev1.Pod{}
|
||||
err := f.kubeClient.Get(ctx, kbclient.ObjectKey{
|
||||
Name: dataUploadName,
|
||||
@@ -326,11 +326,11 @@ type fakeDataUploadFSBR struct {
|
||||
startErr error
|
||||
}
|
||||
|
||||
func (f *fakeDataUploadFSBR) Init(ctx context.Context, param interface{}) error {
|
||||
func (f *fakeDataUploadFSBR) Init(ctx context.Context, param any) error {
|
||||
return f.initErr
|
||||
}
|
||||
|
||||
func (f *fakeDataUploadFSBR) StartBackup(source datapath.AccessPoint, uploaderConfigs map[string]string, param interface{}) error {
|
||||
func (f *fakeDataUploadFSBR) StartBackup(source datapath.AccessPoint, uploaderConfigs map[string]string, param any) error {
|
||||
return f.startErr
|
||||
}
|
||||
|
||||
@@ -1087,11 +1087,11 @@ func (dt *duResumeTestHelper) resumeCancellableDataPath(_ *DataUploadReconciler,
|
||||
return dt.resumeErr
|
||||
}
|
||||
|
||||
func (dt *duResumeTestHelper) Expose(context.Context, corev1.ObjectReference, interface{}) error {
|
||||
func (dt *duResumeTestHelper) Expose(context.Context, corev1.ObjectReference, any) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (dt *duResumeTestHelper) GetExposed(context.Context, corev1.ObjectReference, time.Duration, interface{}) (*exposer.ExposeResult, error) {
|
||||
func (dt *duResumeTestHelper) GetExposed(context.Context, corev1.ObjectReference, time.Duration, any) (*exposer.ExposeResult, error) {
|
||||
return dt.exposeResult, dt.getExposeErr
|
||||
}
|
||||
|
||||
|
||||
@@ -348,7 +348,7 @@ func (r *PodVolumeBackupReconciler) getParentSnapshot(ctx context.Context, log l
|
||||
return ""
|
||||
}
|
||||
|
||||
log.WithFields(map[string]interface{}{
|
||||
log.WithFields(map[string]any{
|
||||
"parentPodVolumeBackup": mostRecentPVB.Name,
|
||||
"parentSnapshotID": mostRecentPVB.Status.SnapshotID,
|
||||
}).Info("Found most recent completed PodVolumeBackup for PVC")
|
||||
|
||||
@@ -97,11 +97,11 @@ type fakeFSBR struct {
|
||||
clock clock.WithTickerAndDelayedExecution
|
||||
}
|
||||
|
||||
func (b *fakeFSBR) Init(ctx context.Context, param interface{}) error {
|
||||
func (b *fakeFSBR) Init(ctx context.Context, param any) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *fakeFSBR) StartBackup(source datapath.AccessPoint, uploaderConfigs map[string]string, param interface{}) error {
|
||||
func (b *fakeFSBR) StartBackup(source datapath.AccessPoint, uploaderConfigs map[string]string, param any) error {
|
||||
pvb := b.pvb
|
||||
|
||||
original := b.pvb.DeepCopy()
|
||||
|
||||
Reference in New Issue
Block a user