Add nolint directives for intentional deprecated function usage

The ShouldPerformSnapshotWithVolumeHelper function and tests intentionally
use NewVolumeHelperImpl (deprecated) for backwards compatibility with
third-party plugins. Add nolint:staticcheck to suppress the linter
warnings with explanatory comments.

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
This commit is contained in:
Shubham Pampattiwar
2025-12-17 10:54:11 -08:00
parent f592a264a6
commit 4ba2effaac
2 changed files with 3 additions and 0 deletions

View File

@@ -322,6 +322,7 @@ func TestVolumeHelperImpl_ShouldPerformSnapshot(t *testing.T) {
t.Fatalf("failed to build policy with error %v", err) t.Fatalf("failed to build policy with error %v", err)
} }
} }
//nolint:staticcheck // Testing deprecated function for backwards compatibility
vh := NewVolumeHelperImpl( vh := NewVolumeHelperImpl(
p, p,
tc.snapshotVolumesFlag, tc.snapshotVolumesFlag,
@@ -687,6 +688,7 @@ func TestVolumeHelperImpl_ShouldPerformFSBackup(t *testing.T) {
t.Fatalf("failed to build policy with error %v", err) t.Fatalf("failed to build policy with error %v", err)
} }
} }
//nolint:staticcheck // Testing deprecated function for backwards compatibility
vh := NewVolumeHelperImpl( vh := NewVolumeHelperImpl(
p, p,
tc.snapshotVolumesFlag, tc.snapshotVolumesFlag,

View File

@@ -83,6 +83,7 @@ func ShouldPerformSnapshotWithVolumeHelper(
return false, err return false, err
} }
//nolint:staticcheck // Intentional use of deprecated function for backwards compatibility
volumeHelperImpl := volumehelper.NewVolumeHelperImpl( volumeHelperImpl := volumehelper.NewVolumeHelperImpl(
resourcePolicies, resourcePolicies,
backup.Spec.SnapshotVolumes, backup.Spec.SnapshotVolumes,