mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Remove unused endpointSlicesEnabled fields
This commit is contained in:
parent
91338c13df
commit
07de59ab60
@ -35,7 +35,6 @@ func TestEndpointsAdapterGet(t *testing.T) {
|
||||
endpoints1, _ := generateEndpointsAndSlice("foo", "testing", []int{80, 443}, []string{"10.1.2.3", "10.1.2.4"})
|
||||
|
||||
testCases := map[string]struct {
|
||||
endpointSlicesEnabled bool
|
||||
expectedError error
|
||||
expectedEndpoints *corev1.Endpoints
|
||||
initialState []runtime.Object
|
||||
@ -43,7 +42,6 @@ func TestEndpointsAdapterGet(t *testing.T) {
|
||||
nameParam string
|
||||
}{
|
||||
"single-existing-endpoints": {
|
||||
endpointSlicesEnabled: true,
|
||||
expectedError: nil,
|
||||
expectedEndpoints: endpoints1,
|
||||
initialState: []runtime.Object{endpoints1},
|
||||
@ -51,7 +49,6 @@ func TestEndpointsAdapterGet(t *testing.T) {
|
||||
nameParam: "foo",
|
||||
},
|
||||
"wrong-namespace": {
|
||||
endpointSlicesEnabled: true,
|
||||
expectedError: errors.NewNotFound(schema.GroupResource{Group: "", Resource: "endpoints"}, "foo"),
|
||||
expectedEndpoints: nil,
|
||||
initialState: []runtime.Object{endpoints1},
|
||||
@ -59,7 +56,6 @@ func TestEndpointsAdapterGet(t *testing.T) {
|
||||
nameParam: "foo",
|
||||
},
|
||||
"wrong-name": {
|
||||
endpointSlicesEnabled: true,
|
||||
expectedError: errors.NewNotFound(schema.GroupResource{Group: "", Resource: "endpoints"}, "bar"),
|
||||
expectedEndpoints: nil,
|
||||
initialState: []runtime.Object{endpoints1},
|
||||
@ -100,7 +96,6 @@ func TestEndpointsAdapterCreate(t *testing.T) {
|
||||
epSlice3.AddressType = discovery.AddressTypeIPv6
|
||||
|
||||
testCases := map[string]struct {
|
||||
endpointSlicesEnabled bool
|
||||
expectedError error
|
||||
expectedResult *corev1.Endpoints
|
||||
expectCreate []runtime.Object
|
||||
@ -110,7 +105,6 @@ func TestEndpointsAdapterCreate(t *testing.T) {
|
||||
endpointsParam *corev1.Endpoints
|
||||
}{
|
||||
"single-endpoint": {
|
||||
endpointSlicesEnabled: true,
|
||||
expectedError: nil,
|
||||
expectedResult: endpoints1,
|
||||
expectCreate: []runtime.Object{endpoints1, epSlice1},
|
||||
@ -119,7 +113,6 @@ func TestEndpointsAdapterCreate(t *testing.T) {
|
||||
endpointsParam: endpoints1,
|
||||
},
|
||||
"single-endpoint-partial-ipv6": {
|
||||
endpointSlicesEnabled: true,
|
||||
expectedError: nil,
|
||||
expectedResult: endpoints2,
|
||||
expectCreate: []runtime.Object{endpoints2, epSlice2},
|
||||
@ -128,7 +121,6 @@ func TestEndpointsAdapterCreate(t *testing.T) {
|
||||
endpointsParam: endpoints2,
|
||||
},
|
||||
"single-endpoint-full-ipv6": {
|
||||
endpointSlicesEnabled: true,
|
||||
expectedError: nil,
|
||||
expectedResult: endpoints3,
|
||||
expectCreate: []runtime.Object{endpoints3, epSlice3},
|
||||
@ -137,7 +129,6 @@ func TestEndpointsAdapterCreate(t *testing.T) {
|
||||
endpointsParam: endpoints3,
|
||||
},
|
||||
"existing-endpoint": {
|
||||
endpointSlicesEnabled: true,
|
||||
expectedError: errors.NewAlreadyExists(schema.GroupResource{Group: "", Resource: "endpoints"}, "foo"),
|
||||
expectedResult: nil,
|
||||
initialState: []runtime.Object{endpoints1, epSlice1},
|
||||
@ -186,7 +177,6 @@ func TestEndpointsAdapterUpdate(t *testing.T) {
|
||||
_, epSlice4IPv4 := generateEndpointsAndSlice("foo", "testing", []int{80}, []string{"10.1.2.7", "10.1.2.8"})
|
||||
|
||||
testCases := map[string]struct {
|
||||
endpointSlicesEnabled bool
|
||||
expectedError error
|
||||
expectedResult *corev1.Endpoints
|
||||
expectCreate []runtime.Object
|
||||
@ -196,7 +186,6 @@ func TestEndpointsAdapterUpdate(t *testing.T) {
|
||||
endpointsParam *corev1.Endpoints
|
||||
}{
|
||||
"single-existing-endpoints-no-change": {
|
||||
endpointSlicesEnabled: true,
|
||||
expectedError: nil,
|
||||
expectedResult: endpoints1,
|
||||
initialState: []runtime.Object{endpoints1, epSlice1},
|
||||
@ -208,7 +197,6 @@ func TestEndpointsAdapterUpdate(t *testing.T) {
|
||||
expectUpdate: []runtime.Object{endpoints1},
|
||||
},
|
||||
"existing-endpointslice-replaced-with-updated-ipv4-address-type": {
|
||||
endpointSlicesEnabled: true,
|
||||
expectedError: nil,
|
||||
expectedResult: endpoints4,
|
||||
initialState: []runtime.Object{endpoints4, epSlice4IP},
|
||||
@ -221,7 +209,6 @@ func TestEndpointsAdapterUpdate(t *testing.T) {
|
||||
expectCreate: []runtime.Object{epSlice4IPv4},
|
||||
},
|
||||
"add-ports-and-ips": {
|
||||
endpointSlicesEnabled: true,
|
||||
expectedError: nil,
|
||||
expectedResult: endpoints2,
|
||||
expectUpdate: []runtime.Object{endpoints2, epSlice2},
|
||||
@ -230,7 +217,6 @@ func TestEndpointsAdapterUpdate(t *testing.T) {
|
||||
endpointsParam: endpoints2,
|
||||
},
|
||||
"missing-endpoints": {
|
||||
endpointSlicesEnabled: true,
|
||||
expectedError: errors.NewNotFound(schema.GroupResource{Group: "", Resource: "endpoints"}, "bar"),
|
||||
expectedResult: nil,
|
||||
initialState: []runtime.Object{endpoints1, epSlice1},
|
||||
@ -316,7 +302,6 @@ func TestEndpointsAdapterEnsureEndpointSliceFromEndpoints(t *testing.T) {
|
||||
endpoints2, epSlice2 := generateEndpointsAndSlice("foo", "testing", []int{80, 443}, []string{"10.1.2.3", "10.1.2.4", "10.1.2.5"})
|
||||
|
||||
testCases := map[string]struct {
|
||||
endpointSlicesEnabled bool
|
||||
expectedError error
|
||||
expectedEndpointSlice *discovery.EndpointSlice
|
||||
initialState []runtime.Object
|
||||
@ -324,7 +309,6 @@ func TestEndpointsAdapterEnsureEndpointSliceFromEndpoints(t *testing.T) {
|
||||
endpointsParam *corev1.Endpoints
|
||||
}{
|
||||
"existing-endpointslice-no-change": {
|
||||
endpointSlicesEnabled: true,
|
||||
expectedError: nil,
|
||||
expectedEndpointSlice: epSlice1,
|
||||
initialState: []runtime.Object{epSlice1},
|
||||
@ -332,7 +316,6 @@ func TestEndpointsAdapterEnsureEndpointSliceFromEndpoints(t *testing.T) {
|
||||
endpointsParam: endpoints1,
|
||||
},
|
||||
"existing-endpointslice-change": {
|
||||
endpointSlicesEnabled: true,
|
||||
expectedError: nil,
|
||||
expectedEndpointSlice: epSlice2,
|
||||
initialState: []runtime.Object{epSlice1},
|
||||
@ -340,7 +323,6 @@ func TestEndpointsAdapterEnsureEndpointSliceFromEndpoints(t *testing.T) {
|
||||
endpointsParam: endpoints2,
|
||||
},
|
||||
"missing-endpointslice": {
|
||||
endpointSlicesEnabled: true,
|
||||
expectedError: nil,
|
||||
expectedEndpointSlice: epSlice1,
|
||||
initialState: []runtime.Object{},
|
||||
|
Loading…
Reference in New Issue
Block a user