Remove PodHostIPs feature gates.

Signed-off-by: Lan Liang <gcslyp@gmail.com>
This commit is contained in:
Lan Liang
2024-09-14 09:45:48 +00:00
committed by Tim Hockin
parent 4c487b00af
commit 6e5a3cde50
10 changed files with 37 additions and 212 deletions

View File

@@ -23736,41 +23736,6 @@ func TestValidateAppArmorProfileFormat(t *testing.T) {
}
}
func TestValidateDownwardAPIHostIPs(t *testing.T) {
testCases := []struct {
name string
expectError bool
featureEnabled bool
fieldSel *core.ObjectFieldSelector
}{
{
name: "has no hostIPs field, featuregate enabled",
expectError: false,
featureEnabled: true,
fieldSel: &core.ObjectFieldSelector{FieldPath: "status.hostIP"},
},
{
name: "has hostIPs field, featuregate enabled",
expectError: false,
featureEnabled: true,
fieldSel: &core.ObjectFieldSelector{FieldPath: "status.hostIPs"},
},
}
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.PodHostIPs, testCase.featureEnabled)
errs := validateDownwardAPIHostIPs(testCase.fieldSel, field.NewPath("fieldSel"), PodValidationOptions{AllowHostIPsField: testCase.featureEnabled})
if testCase.expectError && len(errs) == 0 {
t.Errorf("Unexpected success")
}
if !testCase.expectError && len(errs) != 0 {
t.Errorf("Unexpected error(s): %v", errs)
}
})
}
}
func TestValidatePVSecretReference(t *testing.T) {
rootFld := field.NewPath("name")
type args struct {