diff --git a/pkg/cloudprovider/providers/gce/gce_alpha.go b/pkg/cloudprovider/providers/gce/gce_alpha.go index 8cff6583b47..884b822cbac 100644 --- a/pkg/cloudprovider/providers/gce/gce_alpha.go +++ b/pkg/cloudprovider/providers/gce/gce_alpha.go @@ -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} } diff --git a/pkg/cloudprovider/providers/gce/gce_test.go b/pkg/cloudprovider/providers/gce/gce_test.go index c7267d2908d..cb88f3a486a 100644 --- a/pkg/cloudprovider/providers/gce/gce_test.go +++ b/pkg/cloudprovider/providers/gce/gce_test.go @@ -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) {