diff --git a/pkg/controller/volume/persistentvolume/pv_controller_test.go b/pkg/controller/volume/persistentvolume/pv_controller_test.go index a86a537061b..3da736cf6b0 100644 --- a/pkg/controller/volume/persistentvolume/pv_controller_test.go +++ b/pkg/controller/volume/persistentvolume/pv_controller_test.go @@ -678,6 +678,9 @@ func TestAnnealMigrationAnnotations(t *testing.T) { } func TestUpdateFinalizer(t *testing.T) { + // This set of tests ensures that protection finalizer is removed when CSI migration is disabled + // and PV controller needs to remove finalizers added by the external-provisioner. + defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.CSIMigrationGCE, false)() defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.HonorPVReclaimPolicy, true)() const gcePlugin = "kubernetes.io/gce-pd" const gceDriver = "pd.csi.storage.gke.io"