File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -73,3 +73,27 @@ func TestAllRegisteredFeaturesExpected(t *testing.T) {
73
73
}
74
74
}
75
75
}
76
+ func TestEnsureAlphaGatesAreNotSwitchedOnByDefault (t * testing.T ) {
77
+ checkAlphaGates := func (feature featuregate.Feature , spec featuregate.FeatureSpec ) {
78
+ // FIXME(dims): remove this check when WindowsHostNetwork is fixed up or removed
79
+ // entirely. Please do NOT add more entries here.
80
+ if feature == "WindowsHostNetwork" {
81
+ return
82
+ }
83
+ if spec .PreRelease == featuregate .Alpha && spec .Default {
84
+ t .Errorf ("The alpha feature gate %q is switched on by default" , feature )
85
+ }
86
+ if spec .PreRelease == featuregate .Alpha && spec .LockToDefault {
87
+ t .Errorf ("The alpha feature gate %q is locked to default" , feature )
88
+ }
89
+ }
90
+
91
+ for feature , spec := range defaultKubernetesFeatureGates {
92
+ checkAlphaGates (feature , spec )
93
+ }
94
+ for feature , specs := range defaultVersionedKubernetesFeatureGates {
95
+ for _ , spec := range specs {
96
+ checkAlphaGates (feature , spec )
97
+ }
98
+ }
99
+ }
You can’t perform that action at this time.
0 commit comments