From 6302f011211e93a6048b3b677db13a5af21f02ba Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Tue, 24 Oct 2023 11:19:03 +0200 Subject: [PATCH] e2e node: fix broken assertion It looks like the test or the branch is never executed, because it wouldn't pass: a []v1.NodeIP is value is never the same as []string. Found by the upcoming ginkgolinter update. ERROR: test/e2e_node/pod_host_ips.go:167:45: ginkgo-linter: use Equal with different types: Comparing []k8s.io/api/core/v1.HostIP with []string; either change the expected value type if possible, or use the BeEquivalentTo() matcher, instead of Equal() (ginkgolinter) ERROR: gomega.Expect(p.Status.HostIPs).Should(gomega.Equal(nodeIPs)) ERROR: ^ --- test/e2e_node/pod_host_ips.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/e2e_node/pod_host_ips.go b/test/e2e_node/pod_host_ips.go index 106135570e0..25c81b831c7 100644 --- a/test/e2e_node/pod_host_ips.go +++ b/test/e2e_node/pod_host_ips.go @@ -158,10 +158,10 @@ var _ = common.SIGDescribe("Dual Stack Host IP [Feature:PodHostIPs]", func() { framework.ExpectNoError(err) for _, node := range nodeList.Items { if node.Name == p.Spec.NodeName { - nodeIPs := []string{} + nodeIPs := []v1.HostIP{} for _, address := range node.Status.Addresses { if address.Type == v1.NodeInternalIP { - nodeIPs = append(nodeIPs, address.Address) + nodeIPs = append(nodeIPs, v1.HostIP{IP: address.Address}) } } gomega.Expect(p.Status.HostIPs).Should(gomega.Equal(nodeIPs)) @@ -214,10 +214,10 @@ var _ = common.SIGDescribe("Dual Stack Host IP [Feature:PodHostIPs]", func() { framework.ExpectNoError(err) for _, node := range nodeList.Items { if node.Name == p.Spec.NodeName { - nodeIPs := []string{} + nodeIPs := []v1.HostIP{} for _, address := range node.Status.Addresses { if address.Type == v1.NodeInternalIP { - nodeIPs = append(nodeIPs, address.Address) + nodeIPs = append(nodeIPs, v1.HostIP{IP: address.Address}) } } gomega.Expect(p.Status.HostIPs).Should(gomega.Equal(nodeIPs))