From 74fcd97c84a17657120bfdd22efc0e456acd5348 Mon Sep 17 00:00:00 2001 From: Scott Creeley Date: Tue, 21 Nov 2017 15:16:25 -0500 Subject: [PATCH] fixing issue of feature gate not being turned off properly --- pkg/controller/volume/persistentvolume/binder_test.go | 7 +------ pkg/controller/volume/persistentvolume/index_test.go | 5 +++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/controller/volume/persistentvolume/binder_test.go b/pkg/controller/volume/persistentvolume/binder_test.go index c500277d9a4..8288cd0ca82 100644 --- a/pkg/controller/volume/persistentvolume/binder_test.go +++ b/pkg/controller/volume/persistentvolume/binder_test.go @@ -720,14 +720,9 @@ func TestSyncAlphaBlockVolume(t *testing.T) { t.Errorf("Failed to enable feature gate for BlockVolume: %v", err) return } + defer utilfeature.DefaultFeatureGate.Set("BlockVolume=false") runSyncTests(t, tests, []*storage.StorageClass{}) - - err1 := utilfeature.DefaultFeatureGate.Set("BlockVolume=false") - if err1 != nil { - t.Errorf("Failed to disable feature gate for BlockVolume: %v", err) - return - } } // Test multiple calls to syncClaim/syncVolume and periodic sync of all diff --git a/pkg/controller/volume/persistentvolume/index_test.go b/pkg/controller/volume/persistentvolume/index_test.go index 0f6551fa382..a1edc3bb286 100644 --- a/pkg/controller/volume/persistentvolume/index_test.go +++ b/pkg/controller/volume/persistentvolume/index_test.go @@ -839,6 +839,8 @@ func TestAlphaVolumeModeCheck(t *testing.T) { } } + // make sure feature gate is turned off + toggleBlockVolumeFeature(false, t) } func TestAlphaFilteringVolumeModes(t *testing.T) { @@ -933,6 +935,9 @@ func TestAlphaFilteringVolumeModes(t *testing.T) { t.Errorf("Unexpected failure for scenario: %s - %+v", name, err) } } + + // make sure feature gate is turned off + toggleBlockVolumeFeature(false, t) } func TestFindingPreboundVolumes(t *testing.T) {