From 4ba2effaac47be137918e43bb3f5beaf100db7d5 Mon Sep 17 00:00:00 2001 From: Shubham Pampattiwar Date: Wed, 17 Dec 2025 10:54:11 -0800 Subject: [PATCH] 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 --- internal/volumehelper/volume_policy_helper_test.go | 2 ++ pkg/plugin/utils/volumehelper/volume_policy_helper.go | 1 + 2 files changed, 3 insertions(+) diff --git a/internal/volumehelper/volume_policy_helper_test.go b/internal/volumehelper/volume_policy_helper_test.go index 8d6073c2b..278c2af68 100644 --- a/internal/volumehelper/volume_policy_helper_test.go +++ b/internal/volumehelper/volume_policy_helper_test.go @@ -322,6 +322,7 @@ func TestVolumeHelperImpl_ShouldPerformSnapshot(t *testing.T) { t.Fatalf("failed to build policy with error %v", err) } } + //nolint:staticcheck // Testing deprecated function for backwards compatibility vh := NewVolumeHelperImpl( p, tc.snapshotVolumesFlag, @@ -687,6 +688,7 @@ func TestVolumeHelperImpl_ShouldPerformFSBackup(t *testing.T) { t.Fatalf("failed to build policy with error %v", err) } } + //nolint:staticcheck // Testing deprecated function for backwards compatibility vh := NewVolumeHelperImpl( p, tc.snapshotVolumesFlag, diff --git a/pkg/plugin/utils/volumehelper/volume_policy_helper.go b/pkg/plugin/utils/volumehelper/volume_policy_helper.go index 8fda7f5af..a19f8d7c8 100644 --- a/pkg/plugin/utils/volumehelper/volume_policy_helper.go +++ b/pkg/plugin/utils/volumehelper/volume_policy_helper.go @@ -83,6 +83,7 @@ func ShouldPerformSnapshotWithVolumeHelper( return false, err } + //nolint:staticcheck // Intentional use of deprecated function for backwards compatibility volumeHelperImpl := volumehelper.NewVolumeHelperImpl( resourcePolicies, backup.Spec.SnapshotVolumes,