mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-01 02:38:12 +00:00
Remove PodHostIPs feature gates.
Signed-off-by: Lan Liang <gcslyp@gmail.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user