kubernetes: k8s.io/kubernetes/staging/src/k8s.io/component-base/featuregate/testing Index | Files

package testing

import "k8s.io/kubernetes/staging/src/k8s.io/component-base/featuregate/testing"


Package Files


func SetFeatureGateDuringTest Uses

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)()

Package testing imports 3 packages (graph). Updated 2020-02-25. Refresh now. Tools for package owners.