mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
remove knownAlphaFeatures, only store input features.
This commit is contained in:
parent
d5904e7a4e
commit
ad026f29d3
@ -30,9 +30,6 @@ const (
|
||||
AlphaFeatureNetworkEndpointGroup = "NetworkEndpointGroup"
|
||||
)
|
||||
|
||||
// All known alpha features
|
||||
var knownAlphaFeatures = map[string]bool{}
|
||||
|
||||
type AlphaFeatureGate struct {
|
||||
features map[string]bool
|
||||
}
|
||||
@ -44,11 +41,7 @@ func (af *AlphaFeatureGate) Enabled(key string) bool {
|
||||
func NewAlphaFeatureGate(features []string) *AlphaFeatureGate {
|
||||
featureMap := make(map[string]bool)
|
||||
for _, name := range features {
|
||||
if _, ok := knownAlphaFeatures[name]; !ok {
|
||||
featureMap[name] = false
|
||||
} else {
|
||||
featureMap[name] = true
|
||||
}
|
||||
featureMap[name] = true
|
||||
}
|
||||
return &AlphaFeatureGate{featureMap}
|
||||
}
|
||||
|
@ -531,9 +531,6 @@ func getTestOperation() *computev1.Operation {
|
||||
}
|
||||
|
||||
func TestNewAlphaFeatureGate(t *testing.T) {
|
||||
knownAlphaFeatures["foo"] = true
|
||||
knownAlphaFeatures["bar"] = true
|
||||
|
||||
testCases := []struct {
|
||||
alphaFeatures []string
|
||||
expectEnabled []string
|
||||
@ -555,7 +552,7 @@ func TestNewAlphaFeatureGate(t *testing.T) {
|
||||
{
|
||||
alphaFeatures: []string{"aaa", "foo"},
|
||||
expectEnabled: []string{"foo"},
|
||||
expectDisabled: []string{"aaa"},
|
||||
expectDisabled: []string{},
|
||||
},
|
||||
// enable foo
|
||||
{
|
||||
@ -579,8 +576,6 @@ func TestNewAlphaFeatureGate(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
delete(knownAlphaFeatures, "foo")
|
||||
delete(knownAlphaFeatures, "bar")
|
||||
}
|
||||
|
||||
func TestGetRegionInURL(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user