mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-07 13:55:20 +00:00
Enable linter revive and resolve found errors: part 2. (#6177)
Signed-off-by: Xun Jiang <blackpiglet@gmail.com> Co-authored-by: Xun Jiang <blackpiglet@gmail.com>
This commit is contained in:
committed by
GitHub
parent
a0b0b7cd9b
commit
e106bbf06b
@@ -87,11 +87,11 @@ func (sr *shimRepository) GetManifest(ctx context.Context, id manifest.ID, paylo
|
||||
|
||||
// Get one or more manifest data that match the given labels
|
||||
func (sr *shimRepository) FindManifests(ctx context.Context, labels map[string]string) ([]*manifest.EntryMetadata, error) {
|
||||
if metadata, err := sr.udmRepo.FindManifests(ctx, udmrepo.ManifestFilter{Labels: labels}); err != nil {
|
||||
metadata, err := sr.udmRepo.FindManifests(ctx, udmrepo.ManifestFilter{Labels: labels})
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to get manifests with labels %v", labels)
|
||||
} else {
|
||||
return GetKopiaManifestEntries(metadata), nil
|
||||
}
|
||||
return GetKopiaManifestEntries(metadata), nil
|
||||
}
|
||||
|
||||
// GetKopiaManifestEntries get metadata from specific ManifestEntryMetadata
|
||||
|
||||
@@ -42,7 +42,7 @@ type mockArgs struct {
|
||||
returns []interface{}
|
||||
}
|
||||
|
||||
func InjectSnapshotFuncs() *snapshotMockes {
|
||||
func injectSnapshotFuncs() *snapshotMockes {
|
||||
s := &snapshotMockes{
|
||||
policyMock: &uploadermocks.Policy{},
|
||||
snapshotMock: &uploadermocks.Snapshot{},
|
||||
@@ -184,7 +184,7 @@ func TestSnapshotSource(t *testing.T) {
|
||||
|
||||
for _, tc := range testCases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
s := InjectSnapshotFuncs()
|
||||
s := injectSnapshotFuncs()
|
||||
MockFuncs(s, tc.args)
|
||||
_, _, err = SnapshotSource(ctx, s.repoWriterMock, s.uploderMock, sourceInfo, rootDir, "/", log, "TestSnapshotSource")
|
||||
if tc.notError {
|
||||
|
||||
@@ -81,10 +81,9 @@ func NewUploaderProvider(
|
||||
return nil, errors.Wrap(err, "failed to connect repository")
|
||||
}
|
||||
return NewKopiaUploaderProvider(ctx, credGetter, backupRepo, log)
|
||||
} else {
|
||||
if err := provider.NewResticRepositoryProvider(credGetter.FromFile, filesystem.NewFileSystem(), log).ConnectToRepo(ctx, provider.RepoParam{BackupLocation: bsl, BackupRepo: backupRepo}); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to connect repository")
|
||||
}
|
||||
return NewResticUploaderProvider(repoIdentifier, bsl, credGetter, repoKeySelector, log)
|
||||
}
|
||||
if err := provider.NewResticRepositoryProvider(credGetter.FromFile, filesystem.NewFileSystem(), log).ConnectToRepo(ctx, provider.RepoParam{BackupLocation: bsl, BackupRepo: backupRepo}); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to connect repository")
|
||||
}
|
||||
return NewResticUploaderProvider(repoIdentifier, bsl, credGetter, repoKeySelector, log)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user