Unverified Commit d5bc9a41 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #56168 from screeley44/fix-toggle-bug

Automatic merge from submit-queue (batch tested with PRs 55340, 55329, 56168, 56170, 56105). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. fixing issue of feature gate not being turned off properly Fixes #56166 Adding proper defer and toggle of feature gate for BlockVolume support
parents 5ac4f172 74fcd97c
...@@ -720,14 +720,9 @@ func TestSyncAlphaBlockVolume(t *testing.T) { ...@@ -720,14 +720,9 @@ func TestSyncAlphaBlockVolume(t *testing.T) {
t.Errorf("Failed to enable feature gate for BlockVolume: %v", err) t.Errorf("Failed to enable feature gate for BlockVolume: %v", err)
return return
} }
defer utilfeature.DefaultFeatureGate.Set("BlockVolume=false")
runSyncTests(t, tests, []*storage.StorageClass{}) 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 // Test multiple calls to syncClaim/syncVolume and periodic sync of all
......
...@@ -839,6 +839,8 @@ func TestAlphaVolumeModeCheck(t *testing.T) { ...@@ -839,6 +839,8 @@ func TestAlphaVolumeModeCheck(t *testing.T) {
} }
} }
// make sure feature gate is turned off
toggleBlockVolumeFeature(false, t)
} }
func TestAlphaFilteringVolumeModes(t *testing.T) { func TestAlphaFilteringVolumeModes(t *testing.T) {
...@@ -933,6 +935,9 @@ func TestAlphaFilteringVolumeModes(t *testing.T) { ...@@ -933,6 +935,9 @@ func TestAlphaFilteringVolumeModes(t *testing.T) {
t.Errorf("Unexpected failure for scenario: %s - %+v", name, err) 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) { func TestFindingPreboundVolumes(t *testing.T) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment