@ -21,7 +21,6 @@ import (
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/api/discovery/v1"
"k8s.io/api/discovery/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
@ -114,62 +113,8 @@ func makeEndpointSliceV1() *v1.EndpointSlice {
}
}
func makeEndpointSliceV1beta1 ( ) * v1beta1 . EndpointSlice {
return & v1beta1 . EndpointSlice {
ObjectMeta : metav1 . ObjectMeta {
Name : "testendpoints" ,
Namespace : "default" ,
Labels : map [ string ] string {
v1beta1 . LabelServiceName : "testendpoints" ,
} ,
Annotations : map [ string ] string {
"test.annotation" : "test" ,
} ,
} ,
AddressType : v1beta1 . AddressTypeIPv4 ,
Ports : [ ] v1beta1 . EndpointPort {
{
Name : strptr ( "testport" ) ,
Port : int32ptr ( 9000 ) ,
Protocol : protocolptr ( corev1 . ProtocolTCP ) ,
} ,
} ,
Endpoints : [ ] v1beta1 . Endpoint {
{
Addresses : [ ] string { "1.2.3.4" } ,
Hostname : strptr ( "testendpoint1" ) ,
} , {
Addresses : [ ] string { "2.3.4.5" } ,
Conditions : v1beta1 . EndpointConditions {
Ready : boolptr ( true ) ,
Serving : boolptr ( true ) ,
Terminating : boolptr ( false ) ,
} ,
} , {
Addresses : [ ] string { "3.4.5.6" } ,
Conditions : v1beta1 . EndpointConditions {
Ready : boolptr ( false ) ,
Serving : boolptr ( true ) ,
Terminating : boolptr ( true ) ,
} ,
} , {
Addresses : [ ] string { "4.5.6.7" } ,
Conditions : v1beta1 . EndpointConditions {
Ready : boolptr ( true ) ,
Serving : boolptr ( true ) ,
Terminating : boolptr ( false ) ,
} ,
TargetRef : & corev1 . ObjectReference {
Kind : "Node" ,
Name : "barbaz" ,
} ,
} ,
} ,
}
}
func TestEndpointSliceDiscoveryBeforeRun ( t * testing . T ) {
n , c := makeDiscoveryWithVersion ( RoleEndpointSlice , NamespaceDiscovery { Names : [ ] string { "default" } } , "v1.25.0" )
n , c := makeDiscovery ( RoleEndpointSlice , NamespaceDiscovery { Names : [ ] string { "default" } } )
k8sDiscoveryTest {
discovery : n ,
@ -249,71 +194,6 @@ func TestEndpointSliceDiscoveryBeforeRun(t *testing.T) {
} . Run ( t )
}
func TestEndpointSliceDiscoveryBeforeRunV1beta1 ( t * testing . T ) {
n , c := makeDiscoveryWithVersion ( RoleEndpointSlice , NamespaceDiscovery { Names : [ ] string { "default" } } , "1.20.0" )
k8sDiscoveryTest {
discovery : n ,
beforeRun : func ( ) {
obj := makeEndpointSliceV1beta1 ( )
c . DiscoveryV1beta1 ( ) . EndpointSlices ( obj . Namespace ) . Create ( context . Background ( ) , obj , metav1 . CreateOptions { } )
} ,
expectedMaxItems : 1 ,
expectedRes : map [ string ] * targetgroup . Group {
"endpointslice/default/testendpoints" : {
Targets : [ ] model . LabelSet {
{
"__address__" : "1.2.3.4:9000" ,
"__meta_kubernetes_endpointslice_endpoint_hostname" : "testendpoint1" ,
"__meta_kubernetes_endpointslice_port" : "9000" ,
"__meta_kubernetes_endpointslice_port_name" : "testport" ,
"__meta_kubernetes_endpointslice_port_protocol" : "TCP" ,
} ,
{
"__address__" : "2.3.4.5:9000" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_ready" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_serving" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_terminating" : "false" ,
"__meta_kubernetes_endpointslice_port" : "9000" ,
"__meta_kubernetes_endpointslice_port_name" : "testport" ,
"__meta_kubernetes_endpointslice_port_protocol" : "TCP" ,
} ,
{
"__address__" : "3.4.5.6:9000" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_ready" : "false" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_serving" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_terminating" : "true" ,
"__meta_kubernetes_endpointslice_port" : "9000" ,
"__meta_kubernetes_endpointslice_port_name" : "testport" ,
"__meta_kubernetes_endpointslice_port_protocol" : "TCP" ,
} ,
{
"__address__" : "4.5.6.7:9000" ,
"__meta_kubernetes_endpointslice_address_target_kind" : "Node" ,
"__meta_kubernetes_endpointslice_address_target_name" : "barbaz" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_ready" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_serving" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_terminating" : "false" ,
"__meta_kubernetes_endpointslice_port" : "9000" ,
"__meta_kubernetes_endpointslice_port_name" : "testport" ,
"__meta_kubernetes_endpointslice_port_protocol" : "TCP" ,
} ,
} ,
Labels : model . LabelSet {
"__meta_kubernetes_endpointslice_address_type" : "IPv4" ,
"__meta_kubernetes_namespace" : "default" ,
"__meta_kubernetes_endpointslice_name" : "testendpoints" ,
"__meta_kubernetes_endpointslice_label_kubernetes_io_service_name" : "testendpoints" ,
"__meta_kubernetes_endpointslice_labelpresent_kubernetes_io_service_name" : "true" ,
"__meta_kubernetes_endpointslice_annotation_test_annotation" : "test" ,
"__meta_kubernetes_endpointslice_annotationpresent_test_annotation" : "true" ,
} ,
Source : "endpointslice/default/testendpoints" ,
} ,
} ,
} . Run ( t )
}
func TestEndpointSliceDiscoveryAdd ( t * testing . T ) {
obj := & corev1 . Pod {
ObjectMeta : metav1 . ObjectMeta {
@ -353,25 +233,25 @@ func TestEndpointSliceDiscoveryAdd(t *testing.T) {
PodIP : "1.2.3.4" ,
} ,
}
n , c := makeDiscoveryWithVersion ( RoleEndpointSlice , NamespaceDiscovery { Names : [ ] string { "default" } } , "v1.20.0" , obj )
n , c := makeDiscovery ( RoleEndpointSlice , NamespaceDiscovery { Names : [ ] string { "default" } } , obj )
k8sDiscoveryTest {
discovery : n ,
afterStart : func ( ) {
obj := & v1beta1 . EndpointSlice {
obj := & v1 . EndpointSlice {
ObjectMeta : metav1 . ObjectMeta {
Name : "testendpoints" ,
Namespace : "default" ,
} ,
AddressType : v1beta1 . AddressTypeIPv4 ,
Ports : [ ] v1beta1 . EndpointPort {
AddressType : v1 . AddressTypeIPv4 ,
Ports : [ ] v1 . EndpointPort {
{
Name : strptr ( "testport" ) ,
Port : int32ptr ( 9000 ) ,
Protocol : protocolptr ( corev1 . ProtocolTCP ) ,
} ,
} ,
Endpoints : [ ] v1beta1 . Endpoint {
Endpoints : [ ] v1 . Endpoint {
{
Addresses : [ ] string { "4.3.2.1" } ,
TargetRef : & corev1 . ObjectReference {
@ -379,13 +259,13 @@ func TestEndpointSliceDiscoveryAdd(t *testing.T) {
Name : "testpod" ,
Namespace : "default" ,
} ,
Conditions : v1beta1 . EndpointConditions {
Conditions : v1 . EndpointConditions {
Ready : boolptr ( false ) ,
} ,
} ,
} ,
}
c . DiscoveryV1beta1 ( ) . EndpointSlices ( obj . Namespace ) . Create ( context . Background ( ) , obj , metav1 . CreateOptions { } )
c . DiscoveryV1 ( ) . EndpointSlices ( obj . Namespace ) . Create ( context . Background ( ) , obj , metav1 . CreateOptions { } )
} ,
expectedMaxItems : 1 ,
expectedRes : map [ string ] * targetgroup . Group {
@ -440,118 +320,34 @@ func TestEndpointSliceDiscoveryAdd(t *testing.T) {
}
func TestEndpointSliceDiscoveryDelete ( t * testing . T ) {
n , c := makeDiscoveryWithVersion ( RoleEndpointSlice , NamespaceDiscovery { Names : [ ] string { "default" } } , "v1.21.0" , makeEndpointSliceV1 ( ) )
n , c := makeDiscovery ( RoleEndpointSlice , NamespaceDiscovery { Names : [ ] string { "default" } } , makeEndpointSliceV1 ( ) )
k8sDiscoveryTest {
discovery : n ,
afterStart : func ( ) {
obj := makeEndpointSliceV1 ( )
c . DiscoveryV1beta1 ( ) . EndpointSlices ( obj . Namespace ) . Delete ( context . Background ( ) , obj . Name , metav1 . DeleteOptions { } )
c . DiscoveryV1 ( ) . EndpointSlices ( obj . Namespace ) . Delete ( context . Background ( ) , obj . Name , metav1 . DeleteOptions { } )
} ,
expectedMaxItems : 2 ,
expectedRes : map [ string ] * targetgroup . Group {
"endpointslice/default/testendpoints" : {
Source : "endpointslice/default/testendpoints" ,
Targets : [ ] model . LabelSet {
{
"__address__" : "1.2.3.4:9000" ,
"__meta_kubernetes_endpointslice_address_target_kind" : "" ,
"__meta_kubernetes_endpointslice_address_target_name" : "" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_ready" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_serving" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_terminating" : "false" ,
"__meta_kubernetes_endpointslice_endpoint_hostname" : "testendpoint1" ,
"__meta_kubernetes_endpointslice_endpoint_node_name" : "foobar" ,
"__meta_kubernetes_endpointslice_endpoint_topology_present_topology" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_topology_topology" : "value" ,
"__meta_kubernetes_endpointslice_endpoint_zone" : "us-east-1a" ,
"__meta_kubernetes_endpointslice_port" : "9000" ,
"__meta_kubernetes_endpointslice_port_app_protocol" : "http" ,
"__meta_kubernetes_endpointslice_port_name" : "testport" ,
"__meta_kubernetes_endpointslice_port_protocol" : "TCP" ,
} ,
{
"__address__" : "2.3.4.5:9000" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_ready" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_serving" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_terminating" : "false" ,
"__meta_kubernetes_endpointslice_endpoint_zone" : "us-east-1b" ,
"__meta_kubernetes_endpointslice_port" : "9000" ,
"__meta_kubernetes_endpointslice_port_app_protocol" : "http" ,
"__meta_kubernetes_endpointslice_port_name" : "testport" ,
"__meta_kubernetes_endpointslice_port_protocol" : "TCP" ,
} ,
{
"__address__" : "3.4.5.6:9000" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_ready" : "false" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_serving" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_terminating" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_zone" : "us-east-1c" ,
"__meta_kubernetes_endpointslice_port" : "9000" ,
"__meta_kubernetes_endpointslice_port_app_protocol" : "http" ,
"__meta_kubernetes_endpointslice_port_name" : "testport" ,
"__meta_kubernetes_endpointslice_port_protocol" : "TCP" ,
} ,
{
"__address__" : "4.5.6.7:9000" ,
"__meta_kubernetes_endpointslice_address_target_kind" : "Node" ,
"__meta_kubernetes_endpointslice_address_target_name" : "barbaz" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_ready" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_serving" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_terminating" : "false" ,
"__meta_kubernetes_endpointslice_endpoint_zone" : "us-east-1a" ,
"__meta_kubernetes_endpointslice_port" : "9000" ,
"__meta_kubernetes_endpointslice_port_app_protocol" : "http" ,
"__meta_kubernetes_endpointslice_port_name" : "testport" ,
"__meta_kubernetes_endpointslice_port_protocol" : "TCP" ,
} ,
} ,
Labels : map [ model . LabelName ] model . LabelValue {
"__meta_kubernetes_endpointslice_address_type" : "IPv4" ,
"__meta_kubernetes_endpointslice_name" : "testendpoints" ,
"__meta_kubernetes_endpointslice_label_kubernetes_io_service_name" : "testendpoints" ,
"__meta_kubernetes_endpointslice_labelpresent_kubernetes_io_service_name" : "true" ,
"__meta_kubernetes_endpointslice_annotation_test_annotation" : "test" ,
"__meta_kubernetes_endpointslice_annotationpresent_test_annotation" : "true" ,
"__meta_kubernetes_namespace" : "default" ,
} ,
} ,
} ,
} . Run ( t )
}
func TestEndpointSliceDiscoveryUpdate ( t * testing . T ) {
n , c := makeDiscoveryWithVersion ( RoleEndpointSlice , NamespaceDiscovery { Names : [ ] string { "default" } } , "v1.21.0" , makeEndpointSliceV1 ( ) )
n , c := makeDiscovery ( RoleEndpointSlice , NamespaceDiscovery { Names : [ ] string { "default" } } , makeEndpointSliceV1 ( ) )
k8sDiscoveryTest {
discovery : n ,
afterStart : func ( ) {
obj := & v1beta1 . EndpointSlice {
ObjectMeta : metav1 . ObjectMeta {
Name : "testendpoints" ,
Namespace : "default" ,
} ,
AddressType : v1beta1 . AddressTypeIPv4 ,
Ports : [ ] v1beta1 . EndpointPort {
{
Name : strptr ( "testport" ) ,
Port : int32ptr ( 9000 ) ,
Protocol : protocolptr ( corev1 . ProtocolTCP ) ,
} ,
} ,
Endpoints : [ ] v1beta1 . Endpoint {
{
Addresses : [ ] string { "1.2.3.4" } ,
Hostname : strptr ( "testendpoint1" ) ,
} , {
Addresses : [ ] string { "2.3.4.5" } ,
Conditions : v1beta1 . EndpointConditions {
Ready : boolptr ( true ) ,
} ,
} ,
} ,
}
c . DiscoveryV1beta1 ( ) . EndpointSlices ( obj . Namespace ) . Update ( context . Background ( ) , obj , metav1 . UpdateOptions { } )
obj := makeEndpointSliceV1 ( )
obj . ObjectMeta . Labels = nil
obj . ObjectMeta . Annotations = nil
obj . Endpoints = obj . Endpoints [ 0 : 2 ]
c . DiscoveryV1 ( ) . EndpointSlices ( obj . Namespace ) . Update ( context . Background ( ) , obj , metav1 . UpdateOptions { } )
} ,
expectedMaxItems : 2 ,
expectedRes : map [ string ] * targetgroup . Group {
@ -586,39 +382,11 @@ func TestEndpointSliceDiscoveryUpdate(t *testing.T) {
"__meta_kubernetes_endpointslice_port_name" : "testport" ,
"__meta_kubernetes_endpointslice_port_protocol" : "TCP" ,
} ,
{
"__address__" : "3.4.5.6:9000" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_ready" : "false" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_serving" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_terminating" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_zone" : "us-east-1c" ,
"__meta_kubernetes_endpointslice_port" : "9000" ,
"__meta_kubernetes_endpointslice_port_app_protocol" : "http" ,
"__meta_kubernetes_endpointslice_port_name" : "testport" ,
"__meta_kubernetes_endpointslice_port_protocol" : "TCP" ,
} ,
{
"__address__" : "4.5.6.7:9000" ,
"__meta_kubernetes_endpointslice_address_target_kind" : "Node" ,
"__meta_kubernetes_endpointslice_address_target_name" : "barbaz" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_ready" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_serving" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_terminating" : "false" ,
"__meta_kubernetes_endpointslice_endpoint_zone" : "us-east-1a" ,
"__meta_kubernetes_endpointslice_port" : "9000" ,
"__meta_kubernetes_endpointslice_port_app_protocol" : "http" ,
"__meta_kubernetes_endpointslice_port_name" : "testport" ,
"__meta_kubernetes_endpointslice_port_protocol" : "TCP" ,
} ,
} ,
Labels : model . LabelSet {
"__meta_kubernetes_endpointslice_address_type" : "IPv4" ,
"__meta_kubernetes_endpointslice_name" : "testendpoints" ,
"__meta_kubernetes_endpointslice_label_kubernetes_io_service_name" : "testendpoints" ,
"__meta_kubernetes_endpointslice_labelpresent_kubernetes_io_service_name" : "true" ,
"__meta_kubernetes_endpointslice_annotation_test_annotation" : "test" ,
"__meta_kubernetes_endpointslice_annotationpresent_test_annotation" : "true" ,
"__meta_kubernetes_namespace" : "default" ,
"__meta_kubernetes_endpointslice_address_type" : "IPv4" ,
"__meta_kubernetes_endpointslice_name" : "testendpoints" ,
"__meta_kubernetes_namespace" : "default" ,
} ,
} ,
} ,
@ -626,85 +394,18 @@ func TestEndpointSliceDiscoveryUpdate(t *testing.T) {
}
func TestEndpointSliceDiscoveryEmptyEndpoints ( t * testing . T ) {
n , c := makeDiscoveryWithVersion ( RoleEndpointSlice , NamespaceDiscovery { Names : [ ] string { "default" } } , "v1.21.0" , makeEndpointSliceV1 ( ) )
n , c := makeDiscovery ( RoleEndpointSlice , NamespaceDiscovery { Names : [ ] string { "default" } } , makeEndpointSliceV1 ( ) )
k8sDiscoveryTest {
discovery : n ,
afterStart : func ( ) {
obj := & v1beta1 . EndpointSlice {
ObjectMeta : metav1 . ObjectMeta {
Name : "testendpoints" ,
Namespace : "default" ,
} ,
AddressType : v1beta1 . AddressTypeIPv4 ,
Ports : [ ] v1beta1 . EndpointPort {
{
Name : strptr ( "testport" ) ,
Port : int32ptr ( 9000 ) ,
Protocol : protocolptr ( corev1 . ProtocolTCP ) ,
} ,
} ,
Endpoints : [ ] v1beta1 . Endpoint { } ,
}
c . DiscoveryV1beta1 ( ) . EndpointSlices ( obj . Namespace ) . Update ( context . Background ( ) , obj , metav1 . UpdateOptions { } )
obj := makeEndpointSliceV1 ( )
obj . Endpoints = [ ] v1 . Endpoint { }
c . DiscoveryV1 ( ) . EndpointSlices ( obj . Namespace ) . Update ( context . Background ( ) , obj , metav1 . UpdateOptions { } )
} ,
expectedMaxItems : 2 ,
expectedRes : map [ string ] * targetgroup . Group {
"endpointslice/default/testendpoints" : {
Targets : [ ] model . LabelSet {
{
"__address__" : "1.2.3.4:9000" ,
"__meta_kubernetes_endpointslice_address_target_kind" : "" ,
"__meta_kubernetes_endpointslice_address_target_name" : "" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_ready" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_serving" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_terminating" : "false" ,
"__meta_kubernetes_endpointslice_endpoint_hostname" : "testendpoint1" ,
"__meta_kubernetes_endpointslice_endpoint_node_name" : "foobar" ,
"__meta_kubernetes_endpointslice_endpoint_topology_present_topology" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_topology_topology" : "value" ,
"__meta_kubernetes_endpointslice_endpoint_zone" : "us-east-1a" ,
"__meta_kubernetes_endpointslice_port" : "9000" ,
"__meta_kubernetes_endpointslice_port_app_protocol" : "http" ,
"__meta_kubernetes_endpointslice_port_name" : "testport" ,
"__meta_kubernetes_endpointslice_port_protocol" : "TCP" ,
} ,
{
"__address__" : "2.3.4.5:9000" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_ready" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_serving" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_terminating" : "false" ,
"__meta_kubernetes_endpointslice_endpoint_zone" : "us-east-1b" ,
"__meta_kubernetes_endpointslice_port" : "9000" ,
"__meta_kubernetes_endpointslice_port_app_protocol" : "http" ,
"__meta_kubernetes_endpointslice_port_name" : "testport" ,
"__meta_kubernetes_endpointslice_port_protocol" : "TCP" ,
} ,
{
"__address__" : "3.4.5.6:9000" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_ready" : "false" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_serving" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_terminating" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_zone" : "us-east-1c" ,
"__meta_kubernetes_endpointslice_port" : "9000" ,
"__meta_kubernetes_endpointslice_port_app_protocol" : "http" ,
"__meta_kubernetes_endpointslice_port_name" : "testport" ,
"__meta_kubernetes_endpointslice_port_protocol" : "TCP" ,
} ,
{
"__address__" : "4.5.6.7:9000" ,
"__meta_kubernetes_endpointslice_address_target_kind" : "Node" ,
"__meta_kubernetes_endpointslice_address_target_name" : "barbaz" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_ready" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_serving" : "true" ,
"__meta_kubernetes_endpointslice_endpoint_conditions_terminating" : "false" ,
"__meta_kubernetes_endpointslice_endpoint_zone" : "us-east-1a" ,
"__meta_kubernetes_endpointslice_port" : "9000" ,
"__meta_kubernetes_endpointslice_port_app_protocol" : "http" ,
"__meta_kubernetes_endpointslice_port_name" : "testport" ,
"__meta_kubernetes_endpointslice_port_protocol" : "TCP" ,
} ,
} ,
Labels : model . LabelSet {
"__meta_kubernetes_endpointslice_address_type" : "IPv4" ,
"__meta_kubernetes_endpointslice_name" : "testendpoints" ,
@ -721,7 +422,7 @@ func TestEndpointSliceDiscoveryEmptyEndpoints(t *testing.T) {
}
func TestEndpointSliceDiscoveryWithService ( t * testing . T ) {
n , c := makeDiscoveryWithVersion ( RoleEndpointSlice , NamespaceDiscovery { Names : [ ] string { "default" } } , "v1.21.0" , makeEndpointSliceV1 ( ) )
n , c := makeDiscovery ( RoleEndpointSlice , NamespaceDiscovery { Names : [ ] string { "default" } } , makeEndpointSliceV1 ( ) )
k8sDiscoveryTest {
discovery : n ,
@ -813,7 +514,7 @@ func TestEndpointSliceDiscoveryWithService(t *testing.T) {
}
func TestEndpointSliceDiscoveryWithServiceUpdate ( t * testing . T ) {
n , c := makeDiscoveryWithVersion ( RoleEndpointSlice , NamespaceDiscovery { Names : [ ] string { "default" } } , "v1.21.0" , makeEndpointSliceV1 ( ) )
n , c := makeDiscovery ( RoleEndpointSlice , NamespaceDiscovery { Names : [ ] string { "default" } } , makeEndpointSliceV1 ( ) )
k8sDiscoveryTest {
discovery : n ,