Repository: metallb/metallb
Pull request #1322 (2022-04-14 16:33:03)

Wording: "routing protocols -> "networking protocols" when referring to ARP / NDP
ARP / NDP are networking protocols, but most certainly *not* routing protocols ;)

Thanks for sending a pull request! A few things before we get started:

1. If this is your first time, please read the [contributing guide](https://metallb.universe.tf/community/#contributing)
2. For non-trivial pull requests, please [file an
   issue](https://github.com/metallb/metallb/issues/new) first, and get
   agreement that the change is a good idea, and a general guideline
   for how it should be implemented, before sending code. Large PRs
   that weren't first discussed and agreed upon in an issue won't be
   accepted.
3. If the PR fixes a particular bug, please include the words "Fixed
   #<issue number>" in the PR text, so that the bug auto-closes when
   the PR is merged.


fedepaol: thanks for the PR, @paketb0te . I agree on arp / ndp not being routing protocols, but bgp is a routing protocol more than a networking protocol.
Would you mind rewording to accomodate both? Thanks! 
paketb0te: @fedepaol I reworded it slightly, I think it is more precise now. Thoughts?
fedepaol: > @fedepaol I reworded it slightly, I think it is more precise now. Thoughts?

looks good, thanks!

Patch:
diff --git a/internal/k8s/controllers/endpoints.go b/internal/k8s/controllers/endpoints.go
index c20d8366..f6276b72 100644
--- a/internal/k8s/controllers/endpoints.go
+++ b/internal/k8s/controllers/endpoints.go
@@ -7,7 +7,7 @@ import (
 
 	"go.universe.tf/metallb/internal/k8s/epslices"
 	v1 "k8s.io/api/core/v1"
-	discovery "k8s.io/api/discovery/v1beta1"
+	discovery "k8s.io/api/discovery/v1"
 	apierrors "k8s.io/apimachinery/pkg/api/errors"
 	"k8s.io/apimachinery/pkg/types"
 	"sigs.k8s.io/controller-runtime/pkg/client"
diff --git a/internal/k8s/controllers/service_controller.go b/internal/k8s/controllers/service_controller.go
index bd6381af..c6ad3c1b 100644
--- a/internal/k8s/controllers/service_controller.go
+++ b/internal/k8s/controllers/service_controller.go
@@ -28,7 +28,7 @@ import (
 
 	v1 "k8s.io/api/core/v1"
 
-	discovery "k8s.io/api/discovery/v1beta1"
+	discovery "k8s.io/api/discovery/v1"
 	"k8s.io/apimachinery/pkg/runtime"
 	ctrl "sigs.k8s.io/controller-runtime"
 	"sigs.k8s.io/controller-runtime/pkg/client"
diff --git a/internal/k8s/epslices/endpoint_slices.go b/internal/k8s/epslices/endpoint_slices.go
index 54782ccd..5c93b493 100644
--- a/internal/k8s/epslices/endpoint_slices.go
+++ b/internal/k8s/epslices/endpoint_slices.go
@@ -6,7 +6,7 @@ import (
 	"fmt"
 
 	v1 "k8s.io/api/core/v1"
-	discovery "k8s.io/api/discovery/v1beta1"
+	discovery "k8s.io/api/discovery/v1"
 	"k8s.io/apimachinery/pkg/types"
 )
 
diff --git a/internal/k8s/k8s.go b/internal/k8s/k8s.go
index 48ec1cc7..d5ffa8f9 100644
--- a/internal/k8s/k8s.go
+++ b/internal/k8s/k8s.go
@@ -30,7 +30,7 @@ import (
 	"github.com/pkg/errors"
 	"github.com/prometheus/client_golang/prometheus/promhttp"
 	v1 "k8s.io/api/core/v1"
-	discovery "k8s.io/api/discovery/v1beta1"
+	discovery "k8s.io/api/discovery/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/apimachinery/pkg/fields"
 	utilruntime "k8s.io/apimachinery/pkg/util/runtime"
diff --git a/speaker/bgp_controller.go b/speaker/bgp_controller.go
index d680a14d..ae5ac774 100644
--- a/speaker/bgp_controller.go
+++ b/speaker/bgp_controller.go
@@ -126,8 +126,8 @@ func hasHealthyEndpoint(eps epslices.EpsOrSlices, filterNode func(*string) bool)
 	case epslices.Slices:
 		for _, slice := range eps.SlicesVal {
 			for _, ep := range slice.Endpoints {
-				node := ep.Topology["kubernetes.io/hostname"]
-				if filterNode(&node) {
+				node := ep.NodeName
+				if filterNode(node) {
 					continue
 				}
 				for _, addr := range ep.Addresses {
diff --git a/speaker/layer2_controller.go b/speaker/layer2_controller.go
index 9a07442e..fc1f4d6b 100644
--- a/speaker/layer2_controller.go
+++ b/speaker/layer2_controller.go
@@ -67,10 +67,10 @@ func usableNodes(eps epslices.EpsOrSlices, speakers map[string]bool) []string {
 				if !epslices.IsConditionReady(ep.Conditions) {
 					continue
 				}
-				nodeName := ep.Topology["kubernetes.io/hostname"]
-				if nodeName == "" {
+				if ep.NodeName == nil {
 					continue
 				}
+				nodeName := *ep.NodeName
 				if speakers != nil {
 					if hasSpeaker := speakers[nodeName]; !hasSpeaker {
 						continue
diff --git a/website/content/concepts/_index.md b/website/content/concepts/_index.md
index 0162fd85..5964fb19 100644
--- a/website/content/concepts/_index.md
+++ b/website/content/concepts/_index.md
@@ -44,8 +44,8 @@ as you want, and doesn't care what "kind" of addresses you give it.
 
 After MetalLB has assigned an external IP address to a service, it
 needs to make the network beyond the cluster aware that the IP "lives"
-in the cluster. MetalLB uses standard routing protocols to achieve
-this: ARP, NDP, or BGP.
+in the cluster. MetalLB uses standard networking or routing protocols to achieve
+this, depending on which mode is used: ARP, NDP, or BGP.
 
 ### Layer 2 mode (ARP/NDP)
 


Test patch:
diff --git a/speaker/bgp_controller_test.go b/speaker/bgp_controller_test.go
index f86e841b..fe28621a 100644
--- a/speaker/bgp_controller_test.go
+++ b/speaker/bgp_controller_test.go
@@ -21,7 +21,7 @@ import (
 	"github.com/go-kit/kit/log"
 	"github.com/google/go-cmp/cmp"
 	v1 "k8s.io/api/core/v1"
-	discovery "k8s.io/api/discovery/v1beta1"
+	discovery "k8s.io/api/discovery/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/apimachinery/pkg/labels"
 )
@@ -1118,9 +1118,7 @@ func TestBGPSpeakerEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.5",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris",
-								},
+								NodeName: stringPtr("iris"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -1174,9 +1172,7 @@ func TestBGPSpeakerEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.5",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "pandora",
-								},
+								NodeName: stringPtr("pandora"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -1209,9 +1205,7 @@ func TestBGPSpeakerEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.5",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris",
-								},
+								NodeName: stringPtr("iris"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -1248,9 +1242,7 @@ func TestBGPSpeakerEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.5",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris",
-								},
+								NodeName: stringPtr("iris"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -1283,9 +1275,7 @@ func TestBGPSpeakerEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.5",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris",
-								},
+								NodeName: stringPtr("iris"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -1298,9 +1288,7 @@ func TestBGPSpeakerEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.6",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "pandora",
-								},
+								NodeName: stringPtr("pandora"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -1337,9 +1325,7 @@ func TestBGPSpeakerEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.5",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris",
-								},
+								NodeName: stringPtr("iris"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -1352,9 +1338,7 @@ func TestBGPSpeakerEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.6",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "pandora",
-								},
+								NodeName: stringPtr("pandora"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(false),
 								},
@@ -1367,9 +1351,7 @@ func TestBGPSpeakerEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.7",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris",
-								},
+								NodeName: stringPtr("iris"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -1382,9 +1364,7 @@ func TestBGPSpeakerEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.6",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "pandora",
-								},
+								NodeName: stringPtr("pandora"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -1433,9 +1413,7 @@ func TestBGPSpeakerEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.5",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris",
-								},
+								NodeName: stringPtr("iris"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(false),
 								},
@@ -1468,9 +1446,7 @@ func TestBGPSpeakerEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.5",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris",
-								},
+								NodeName: stringPtr("iris"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -1479,9 +1455,7 @@ func TestBGPSpeakerEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.6",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "pandora",
-								},
+								NodeName: stringPtr("pandora"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(false),
 								},
@@ -1544,9 +1518,7 @@ func TestBGPSpeakerEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.5",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris",
-								},
+								NodeName: stringPtr("iris"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -1612,9 +1584,7 @@ func TestBGPSpeakerEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.5",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris",
-								},
+								NodeName: stringPtr("iris"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -1655,9 +1625,7 @@ func TestBGPSpeakerEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.5",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris",
-								},
+								NodeName: stringPtr("iris"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -1699,9 +1667,7 @@ func TestBGPSpeakerEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.5",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris",
-								},
+								NodeName: stringPtr("iris"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -1749,9 +1715,7 @@ func TestBGPSpeakerEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.5",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris",
-								},
+								NodeName: stringPtr("iris"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -1837,9 +1801,7 @@ func TestBGPSpeakerEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.5",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris",
-								},
+								NodeName: stringPtr("iris"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
diff --git a/speaker/layer2_controller_test.go b/speaker/layer2_controller_test.go
index 64380d0a..da6925a3 100644
--- a/speaker/layer2_controller_test.go
+++ b/speaker/layer2_controller_test.go
@@ -17,7 +17,7 @@ import (
 
 	"github.com/go-kit/kit/log"
 	v1 "k8s.io/api/core/v1"
-	discovery "k8s.io/api/discovery/v1beta1"
+	discovery "k8s.io/api/discovery/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
 
@@ -177,9 +177,7 @@ func TestUsableNodesEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.5",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris1",
-								},
+								NodeName: stringPtr("iris1"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -192,9 +190,7 @@ func TestUsableNodesEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.15",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris2",
-								},
+								NodeName: stringPtr("iris2"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -217,9 +213,7 @@ func TestUsableNodesEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.5",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris1",
-								},
+								NodeName: stringPtr("iris1"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -228,9 +222,7 @@ func TestUsableNodesEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.15",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris2",
-								},
+								NodeName: stringPtr("iris2"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -253,9 +245,7 @@ func TestUsableNodesEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.5",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris1",
-								},
+								NodeName: stringPtr("iris1"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -264,9 +254,7 @@ func TestUsableNodesEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.15",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris1",
-								},
+								NodeName: stringPtr("iris1"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -290,9 +278,7 @@ func TestUsableNodesEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.5",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris1",
-								},
+								NodeName: stringPtr("iris1"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -301,9 +287,7 @@ func TestUsableNodesEPSlices(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.15",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": "iris1",
-								},
+								NodeName: stringPtr("iris1"),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(false),
 								},
@@ -617,7 +601,8 @@ func TestShouldAnnounce(t *testing.T) {
 			c2ExpectedResult: map[string]string{
 				"10.20.30.1": "notOwner",
 			},
-		}, {
+		},
+		{
 			desc: "One service, two endpoints across two hosts, controller 2 is not ready, controller 1 should announce",
 			config: &config.Config{
 				Pools: map[string]*config.Pool{
@@ -665,7 +650,8 @@ func TestShouldAnnounce(t *testing.T) {
 			c2ExpectedResult: map[string]string{
 				"10.20.30.1": "notOwner",
 			},
-		}, {
+		},
+		{
 			desc: "Two services each with two endpoints across across two hosts, controller 1 should announce the second, controller 2 the first",
 			config: &config.Config{
 				Pools: map[string]*config.Pool{
@@ -739,7 +725,8 @@ func TestShouldAnnounce(t *testing.T) {
 				"10.20.30.1": "",
 				"10.20.30.2": "notOwner",
 			},
-		}, {
+		},
+		{
 			desc: "Two services each with two endpoints across across two hosts, one service has an endpoint not ready on controller 2, controller 2 should not announce for the service with the not ready endpoint",
 			config: &config.Config{
 				Pools: map[string]*config.Pool{
@@ -815,7 +802,8 @@ func TestShouldAnnounce(t *testing.T) {
 				"10.20.30.1": "",
 				"10.20.30.2": "notOwner",
 			},
-		}, {
+		},
+		{
 			desc: "Two services each with two endpoints across across two hosts, one service has an endpoint not ready on controller 1, the other service has an endpoint not ready on controller 2. Each controller should announce for the service with the ready endpoint on that controller",
 			config: &config.Config{
 				Pools: map[string]*config.Pool{
@@ -893,7 +881,8 @@ func TestShouldAnnounce(t *testing.T) {
 				"10.20.30.1": "",
 				"10.20.30.2": "notOwner",
 			},
-		}, {
+		},
+		{
 			desc: "One service with three endpoints across across two hosts, controller 2 hosts two endpoints controller 2 should announce for the service",
 			config: &config.Config{
 				Pools: map[string]*config.Pool{
@@ -943,7 +932,8 @@ func TestShouldAnnounce(t *testing.T) {
 			c2ExpectedResult: map[string]string{
 				"10.20.30.1": "",
 			},
-		}, {
+		},
+		{
 			desc: "One service with three endpoints across across two hosts, controller 1 hosts two endpoints controller 2 should announce for the service",
 			config: &config.Config{
 				Pools: map[string]*config.Pool{
@@ -993,7 +983,8 @@ func TestShouldAnnounce(t *testing.T) {
 			c2ExpectedResult: map[string]string{
 				"10.20.30.1": "",
 			},
-		}, {
+		},
+		{
 			desc: "One service with three endpoints across across two hosts, controller 2 hosts two endpoints, one of which is not ready, controller 1 should announce for the service",
 			config: &config.Config{
 				Pools: map[string]*config.Pool{
@@ -1045,7 +1036,8 @@ func TestShouldAnnounce(t *testing.T) {
 			c2ExpectedResult: map[string]string{
 				"10.20.30.1": "",
 			},
-		}, {
+		},
+		{
 			desc: "One service with three endpoints across across two hosts, controller 1 hosts two endpoints, one of which is not ready, controller 2 should announce for the service",
 			config: &config.Config{
 				Pools: map[string]*config.Pool{
@@ -1097,7 +1089,8 @@ func TestShouldAnnounce(t *testing.T) {
 			c2ExpectedResult: map[string]string{
 				"10.20.30.1": "",
 			},
-		}, {
+		},
+		{
 			desc: "One service with three endpoints across across two hosts, controller 2 hosts two endpoints, both of which are not ready, controller 1 should announce for the service",
 			config: &config.Config{
 				Pools: map[string]*config.Pool{
@@ -1253,9 +1246,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.5",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris1",
-									},
+									NodeName: stringPtr("iris1"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1264,9 +1255,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.15",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris1",
-									},
+									NodeName: stringPtr("iris1"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1311,9 +1300,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.5",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris1",
-									},
+									NodeName: stringPtr("iris1"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(false),
 									},
@@ -1322,9 +1309,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.15",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris1",
-									},
+									NodeName: stringPtr("iris1"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(false),
 									},
@@ -1369,9 +1354,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.5",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris1",
-									},
+									NodeName: stringPtr("iris1"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1380,9 +1363,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.15",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris2",
-									},
+									NodeName: stringPtr("iris2"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1427,9 +1408,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.5",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris1",
-									},
+									NodeName: stringPtr("iris1"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(false),
 									},
@@ -1438,9 +1417,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.15",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris2",
-									},
+									NodeName: stringPtr("iris2"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(false),
 									},
@@ -1485,9 +1462,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.5",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris1",
-									},
+									NodeName: stringPtr("iris1"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1496,9 +1471,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.15",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris2",
-									},
+									NodeName: stringPtr("iris2"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(false),
 									},
@@ -1550,9 +1523,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.5",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris1",
-									},
+									NodeName: stringPtr("iris1"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1561,9 +1532,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.15",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris2",
-									},
+									NodeName: stringPtr("iris2"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1581,9 +1550,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.25",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris1",
-									},
+									NodeName: stringPtr("iris1"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1592,9 +1559,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.35",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris2",
-									},
+									NodeName: stringPtr("iris2"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1648,9 +1613,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.5",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris1",
-									},
+									NodeName: stringPtr("iris1"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1659,9 +1622,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.15",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris2",
-									},
+									NodeName: stringPtr("iris2"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1679,9 +1640,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.25",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris1",
-									},
+									NodeName: stringPtr("iris1"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1690,9 +1649,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.35",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris2",
-									},
+									NodeName: stringPtr("iris2"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(false),
 									},
@@ -1746,9 +1703,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.5",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris2",
-									},
+									NodeName: stringPtr("iris2"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1757,9 +1712,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.15",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris1",
-									},
+									NodeName: stringPtr("iris1"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(false),
 									},
@@ -1777,9 +1730,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.25",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris1",
-									},
+									NodeName: stringPtr("iris1"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1788,9 +1739,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.35",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris2",
-									},
+									NodeName: stringPtr("iris2"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(false),
 									},
@@ -1837,9 +1786,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.5",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris1",
-									},
+									NodeName: stringPtr("iris1"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1848,9 +1795,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.15",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris2",
-									},
+									NodeName: stringPtr("iris2"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1863,9 +1808,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.25",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris2",
-									},
+									NodeName: stringPtr("iris2"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1910,9 +1853,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.5",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris1",
-									},
+									NodeName: stringPtr("iris1"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1921,9 +1862,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.15",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris2",
-									},
+									NodeName: stringPtr("iris2"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1932,9 +1871,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.25",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris1",
-									},
+									NodeName: stringPtr("iris1"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1979,9 +1916,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.5",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris1",
-									},
+									NodeName: stringPtr("iris1"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -1990,9 +1925,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.15",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris2",
-									},
+									NodeName: stringPtr("iris2"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -2001,9 +1934,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.25",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris2",
-									},
+									NodeName: stringPtr("iris2"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -2048,9 +1979,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.5",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris1",
-									},
+									NodeName: stringPtr("iris1"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -2059,9 +1988,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.15",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris2",
-									},
+									NodeName: stringPtr("iris2"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -2070,9 +1997,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.25",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris1",
-									},
+									NodeName: stringPtr("iris1"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(false),
 									},
@@ -2117,9 +2042,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.5",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris1",
-									},
+									NodeName: stringPtr("iris1"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(true),
 									},
@@ -2128,9 +2051,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.15",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris2",
-									},
+									NodeName: stringPtr("iris2"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(false),
 									},
@@ -2139,9 +2060,7 @@ func TestShouldAnnounceEPSlices(t *testing.T) {
 									Addresses: []string{
 										"2.3.4.25",
 									},
-									Topology: map[string]string{
-										"kubernetes.io/hostname": "iris2",
-									},
+									NodeName: stringPtr("iris2"),
 									Conditions: discovery.EndpointConditions{
 										Ready: pointer.BoolPtr(false),
 									},
@@ -2262,9 +2181,7 @@ func TestShouldAnnounceNodeSelector(t *testing.T) {
 							Addresses: []string{
 								"2.3.4.5",
 							},
-							Topology: map[string]string{
-								"kubernetes.io/hostname": "iris1",
-							},
+							NodeName: pointer.StrPtr("iris1"),
 							Conditions: discovery.EndpointConditions{
 								Ready: pointer.BoolPtr(true),
 							},
@@ -2273,9 +2190,7 @@ func TestShouldAnnounceNodeSelector(t *testing.T) {
 							Addresses: []string{
 								"2.3.4.15",
 							},
-							Topology: map[string]string{
-								"kubernetes.io/hostname": "iris2",
-							},
+							NodeName: pointer.StrPtr("iris2"),
 							Conditions: discovery.EndpointConditions{
 								Ready: pointer.BoolPtr(true),
 							},
@@ -2297,9 +2212,7 @@ func TestShouldAnnounceNodeSelector(t *testing.T) {
 								Addresses: []string{
 									"2.3.4.5",
 								},
-								Topology: map[string]string{
-									"kubernetes.io/hostname": node,
-								},
+								NodeName: pointer.StrPtr(node),
 								Conditions: discovery.EndpointConditions{
 									Ready: pointer.BoolPtr(true),
 								},
@@ -2429,6 +2342,10 @@ func TestShouldAnnounceNodeSelector(t *testing.T) {
 	}
 }
 
+func stringPtr(s string) *string {
+	return &s
+}
+
 func TestClusterPolicy(t *testing.T) {
 	fakeSL := &fakeSpeakerList{
 		speakers: map[string]bool{
@@ -2489,9 +2406,7 @@ func TestClusterPolicy(t *testing.T) {
 						Addresses: []string{
 							"2.3.4.5",
 						},
-						Topology: map[string]string{
-							"kubernetes.io/hostname": "iris1",
-						},
+						NodeName: stringPtr("iris1"),
 						Conditions: discovery.EndpointConditions{
 							Ready: pointer.BoolPtr(true),
 						},
@@ -2509,9 +2424,7 @@ func TestClusterPolicy(t *testing.T) {
 						Addresses: []string{
 							"2.3.4.5",
 						},
-						Topology: map[string]string{
-							"kubernetes.io/hostname": "iris2",
-						},
+						NodeName: stringPtr("iris2"),
 						Conditions: discovery.EndpointConditions{
 							Ready: pointer.BoolPtr(true),
 						},