skip special features in TestPodSecurityGAOnly

was causing some alpha/beta features to be disabled after running sometimes
This commit is contained in:
Alexander Zielenski 2023-02-28 13:20:47 -08:00
parent a003138bf7
commit 9ef1fc543f

View File

@ -75,7 +75,11 @@ func TestPodSecurity(t *testing.T) {
func TestPodSecurityGAOnly(t *testing.T) {
// Disable all alpha and beta features
for k, v := range utilfeature.DefaultFeatureGate.DeepCopy().GetAll() {
if v.PreRelease == featuregate.Alpha || v.PreRelease == featuregate.Beta {
if k == "AllAlpha" || k == "AllBeta" {
// Skip special features. When processed first, special features may
// erroneously disable other features.
continue
} else if v.PreRelease == featuregate.Alpha || v.PreRelease == featuregate.Beta {
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, k, false)()
}
}