package testing
import "k8s.io/component-base/featuregate/testing"
Index ¶
Functions ¶
func SetFeatureGateDuringTest ¶
func SetFeatureGateDuringTest(tb testing.TB, gate featuregate.FeatureGate, f featuregate.Feature, value bool) func()
SetFeatureGateDuringTest sets the specified gate to the specified value, and returns a function that restores the original value. Failures to set or restore cause the test to fail.
Example use:
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.<FeatureName>, true)()
Source Files ¶
feature_gate.go
- Version
- v0.24.13
- Published
- Apr 12, 2023
- Platform
- js/wasm
- Imports
- 3 packages
- Last checked
- 42 seconds ago –
Tools for package owners.