component-basek8s.io/component-base/featuregate/testing Index | Files

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.30.0-alpha.0
Published
Nov 22, 2023
Platform
js/wasm
Imports
3 packages
Last checked
1 minute ago

Tools for package owners.