|
|
|
@ -52,6 +52,9 @@ func makeEndpointSliceV1() *v1.EndpointSlice {
|
|
|
|
|
Labels: map[string]string{ |
|
|
|
|
v1.LabelServiceName: "testendpoints", |
|
|
|
|
}, |
|
|
|
|
Annotations: map[string]string{ |
|
|
|
|
"test.annotation": "test", |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
AddressType: v1.AddressTypeIPv4, |
|
|
|
|
Ports: []v1.EndpointPort{ |
|
|
|
@ -114,6 +117,9 @@ func makeEndpointSliceV1beta1() *v1beta1.EndpointSlice {
|
|
|
|
|
Labels: map[string]string{ |
|
|
|
|
v1beta1.LabelServiceName: "testendpoints", |
|
|
|
|
}, |
|
|
|
|
Annotations: map[string]string{ |
|
|
|
|
"test.annotation": "test", |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
AddressType: v1beta1.AddressTypeIPv4, |
|
|
|
|
Ports: []v1beta1.EndpointPort{ |
|
|
|
@ -219,9 +225,13 @@ func TestEndpointSliceDiscoveryBeforeRun(t *testing.T) {
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
Labels: model.LabelSet{ |
|
|
|
|
"__meta_kubernetes_endpointslice_address_type": "IPv4", |
|
|
|
|
"__meta_kubernetes_namespace": "default", |
|
|
|
|
"__meta_kubernetes_endpointslice_name": "testendpoints", |
|
|
|
|
"__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", |
|
|
|
|
}, |
|
|
|
@ -280,9 +290,13 @@ func TestEndpointSliceDiscoveryBeforeRunV1beta1(t *testing.T) {
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
Labels: model.LabelSet{ |
|
|
|
|
"__meta_kubernetes_endpointslice_address_type": "IPv4", |
|
|
|
|
"__meta_kubernetes_namespace": "default", |
|
|
|
|
"__meta_kubernetes_endpointslice_name": "testendpoints", |
|
|
|
|
"__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", |
|
|
|
|
}, |
|
|
|
@ -478,9 +492,13 @@ func TestEndpointSliceDiscoveryDelete(t *testing.T) {
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
Labels: map[model.LabelName]model.LabelValue{ |
|
|
|
|
"__meta_kubernetes_endpointslice_address_type": "IPv4", |
|
|
|
|
"__meta_kubernetes_endpointslice_name": "testendpoints", |
|
|
|
|
"__meta_kubernetes_namespace": "default", |
|
|
|
|
"__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", |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
@ -574,9 +592,13 @@ func TestEndpointSliceDiscoveryUpdate(t *testing.T) {
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
Labels: model.LabelSet{ |
|
|
|
|
"__meta_kubernetes_endpointslice_address_type": "IPv4", |
|
|
|
|
"__meta_kubernetes_endpointslice_name": "testendpoints", |
|
|
|
|
"__meta_kubernetes_namespace": "default", |
|
|
|
|
"__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", |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
@ -659,9 +681,13 @@ func TestEndpointSliceDiscoveryEmptyEndpoints(t *testing.T) {
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
Labels: model.LabelSet{ |
|
|
|
|
"__meta_kubernetes_endpointslice_address_type": "IPv4", |
|
|
|
|
"__meta_kubernetes_endpointslice_name": "testendpoints", |
|
|
|
|
"__meta_kubernetes_namespace": "default", |
|
|
|
|
"__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", |
|
|
|
|
}, |
|
|
|
|
Source: "endpointslice/default/testendpoints", |
|
|
|
|
}, |
|
|
|
@ -739,12 +765,16 @@ func TestEndpointSliceDiscoveryWithService(t *testing.T) {
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
Labels: model.LabelSet{ |
|
|
|
|
"__meta_kubernetes_endpointslice_address_type": "IPv4", |
|
|
|
|
"__meta_kubernetes_endpointslice_name": "testendpoints", |
|
|
|
|
"__meta_kubernetes_namespace": "default", |
|
|
|
|
"__meta_kubernetes_service_label_app_name": "test", |
|
|
|
|
"__meta_kubernetes_service_labelpresent_app_name": "true", |
|
|
|
|
"__meta_kubernetes_service_name": "testendpoints", |
|
|
|
|
"__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_service_label_app_name": "test", |
|
|
|
|
"__meta_kubernetes_service_labelpresent_app_name": "true", |
|
|
|
|
"__meta_kubernetes_service_name": "testendpoints", |
|
|
|
|
}, |
|
|
|
|
Source: "endpointslice/default/testendpoints", |
|
|
|
|
}, |
|
|
|
@ -835,14 +865,18 @@ func TestEndpointSliceDiscoveryWithServiceUpdate(t *testing.T) {
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
Labels: model.LabelSet{ |
|
|
|
|
"__meta_kubernetes_endpointslice_address_type": "IPv4", |
|
|
|
|
"__meta_kubernetes_endpointslice_name": "testendpoints", |
|
|
|
|
"__meta_kubernetes_namespace": "default", |
|
|
|
|
"__meta_kubernetes_service_label_app_name": "svc", |
|
|
|
|
"__meta_kubernetes_service_label_component": "testing", |
|
|
|
|
"__meta_kubernetes_service_labelpresent_app_name": "true", |
|
|
|
|
"__meta_kubernetes_service_labelpresent_component": "true", |
|
|
|
|
"__meta_kubernetes_service_name": "testendpoints", |
|
|
|
|
"__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_service_label_app_name": "svc", |
|
|
|
|
"__meta_kubernetes_service_label_component": "testing", |
|
|
|
|
"__meta_kubernetes_service_labelpresent_app_name": "true", |
|
|
|
|
"__meta_kubernetes_service_labelpresent_component": "true", |
|
|
|
|
"__meta_kubernetes_service_name": "testendpoints", |
|
|
|
|
}, |
|
|
|
|
Source: "endpointslice/default/testendpoints", |
|
|
|
|
}, |
|
|
|
@ -927,12 +961,16 @@ func TestEndpointsSlicesDiscoveryWithNodeMetadata(t *testing.T) {
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
Labels: model.LabelSet{ |
|
|
|
|
"__meta_kubernetes_endpointslice_address_type": "IPv4", |
|
|
|
|
"__meta_kubernetes_endpointslice_name": "testendpoints", |
|
|
|
|
"__meta_kubernetes_namespace": "default", |
|
|
|
|
"__meta_kubernetes_service_label_app_name": "test", |
|
|
|
|
"__meta_kubernetes_service_labelpresent_app_name": "true", |
|
|
|
|
"__meta_kubernetes_service_name": "testendpoints", |
|
|
|
|
"__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_service_label_app_name": "test", |
|
|
|
|
"__meta_kubernetes_service_labelpresent_app_name": "true", |
|
|
|
|
"__meta_kubernetes_service_name": "testendpoints", |
|
|
|
|
}, |
|
|
|
|
Source: "endpointslice/default/testendpoints", |
|
|
|
|
}, |
|
|
|
@ -1023,12 +1061,16 @@ func TestEndpointsSlicesDiscoveryWithUpdatedNodeMetadata(t *testing.T) {
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
Labels: model.LabelSet{ |
|
|
|
|
"__meta_kubernetes_endpointslice_address_type": "IPv4", |
|
|
|
|
"__meta_kubernetes_endpointslice_name": "testendpoints", |
|
|
|
|
"__meta_kubernetes_namespace": "default", |
|
|
|
|
"__meta_kubernetes_service_label_app_name": "test", |
|
|
|
|
"__meta_kubernetes_service_labelpresent_app_name": "true", |
|
|
|
|
"__meta_kubernetes_service_name": "testendpoints", |
|
|
|
|
"__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_service_label_app_name": "test", |
|
|
|
|
"__meta_kubernetes_service_labelpresent_app_name": "true", |
|
|
|
|
"__meta_kubernetes_service_name": "testendpoints", |
|
|
|
|
}, |
|
|
|
|
Source: "endpointslice/default/testendpoints", |
|
|
|
|
}, |
|
|
|
@ -1159,12 +1201,16 @@ func TestEndpointSliceDiscoveryNamespaces(t *testing.T) {
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
Labels: model.LabelSet{ |
|
|
|
|
"__meta_kubernetes_endpointslice_address_type": "IPv4", |
|
|
|
|
"__meta_kubernetes_endpointslice_name": "testendpoints", |
|
|
|
|
"__meta_kubernetes_namespace": "ns1", |
|
|
|
|
"__meta_kubernetes_service_label_app": "app1", |
|
|
|
|
"__meta_kubernetes_service_labelpresent_app": "true", |
|
|
|
|
"__meta_kubernetes_service_name": "testendpoints", |
|
|
|
|
"__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": "ns1", |
|
|
|
|
"__meta_kubernetes_service_label_app": "app1", |
|
|
|
|
"__meta_kubernetes_service_labelpresent_app": "true", |
|
|
|
|
"__meta_kubernetes_service_name": "testendpoints", |
|
|
|
|
}, |
|
|
|
|
Source: "endpointslice/ns1/testendpoints", |
|
|
|
|
}, |
|
|
|
@ -1303,9 +1349,13 @@ func TestEndpointSliceDiscoveryOwnNamespace(t *testing.T) {
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
Labels: model.LabelSet{ |
|
|
|
|
"__meta_kubernetes_endpointslice_address_type": "IPv4", |
|
|
|
|
"__meta_kubernetes_endpointslice_name": "testendpoints", |
|
|
|
|
"__meta_kubernetes_namespace": "own-ns", |
|
|
|
|
"__meta_kubernetes_endpointslice_address_type": "IPv4", |
|
|
|
|
"__meta_kubernetes_endpointslice_name": "testendpoints", |
|
|
|
|
"__meta_kubernetes_namespace": "own-ns", |
|
|
|
|
"__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/own-ns/testendpoints", |
|
|
|
|
}, |
|
|
|
|