2019-01-12 04:58:27 +00:00
|
|
|
/*
|
|
|
|
Copyright 2016 The Kubernetes Authors.
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package feature
|
|
|
|
|
|
|
|
import (
|
2019-08-30 18:33:25 +00:00
|
|
|
"k8s.io/component-base/featuregate"
|
2019-01-12 04:58:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2019-04-07 17:07:55 +00:00
|
|
|
// DefaultMutableFeatureGate is a mutable version of DefaultFeatureGate.
|
2019-08-30 18:33:25 +00:00
|
|
|
// Only top-level commands/options setup and the k8s.io/component-base/featuregate/testing package should make use of this.
|
2019-04-07 17:07:55 +00:00
|
|
|
// Tests that need to modify feature gates for the duration of their test should use:
|
2019-08-30 18:33:25 +00:00
|
|
|
// defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.<FeatureName>, <value>)()
|
|
|
|
DefaultMutableFeatureGate featuregate.MutableFeatureGate = featuregate.NewFeatureGate()
|
2019-04-07 17:07:55 +00:00
|
|
|
|
2019-01-12 04:58:27 +00:00
|
|
|
// DefaultFeatureGate is a shared global FeatureGate.
|
2019-04-07 17:07:55 +00:00
|
|
|
// Top-level commands/options setup that needs to modify this feature gate should use DefaultMutableFeatureGate.
|
2019-08-30 18:33:25 +00:00
|
|
|
DefaultFeatureGate featuregate.FeatureGate = DefaultMutableFeatureGate
|
2019-01-12 04:58:27 +00:00
|
|
|
)
|