Merge pull request #116153 from alexzielenski/podsecurity-featuregate-re-enable

skip special features in TestPodSecurityGAOnly
This commit is contained in:
Kubernetes Prow Robot 2023-02-28 16:07:23 -08:00 committed by GitHub
commit 9b213330f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)()
}
}