diff --git a/internal/testing/mock/mock_environment.go b/internal/testing/mock/mock_environment.go index f054f5e7e..813e19338 100644 --- a/internal/testing/mock/mock_environment.go +++ b/internal/testing/mock/mock_environment.go @@ -117,7 +117,7 @@ func CreateMockEnvironment(ctx context.Context, kClient *fake.Clientset) (*MockE }, { IP: ptr.To("127.200.200.1"), }, { - IP: ptr.To("127.300.300.1"), + IP: ptr.To(MockIP), }}, }} filteredAddressesNode, err := createNodeForVM(ctx, kClient, filteredAddressesVM) diff --git a/pkg/provider/manager_test.go b/pkg/provider/manager_test.go index 9218a605d..2332c81a9 100644 --- a/pkg/provider/manager_test.go +++ b/pkg/provider/manager_test.go @@ -158,7 +158,9 @@ var _ = Describe("Test Manager", func() { addresses, err := m.getNodeAddresses(ctx, vm) Expect(err).ShouldNot(HaveOccurred()) Expect(len(addresses)).To(Equal(2), "Received addresses: %v", addresses) - Expect(addresses).Should(ContainElement(v1.NodeAddress{Type: v1.NodeInternalIP, Address: "127.300.300.1"})) + Expect(addresses).Should(ContainElement(v1.NodeAddress{Type: v1.NodeInternalIP, Address: mock.MockIP})) + Expect(addresses).ShouldNot(ContainElement(v1.NodeAddress{Type: v1.NodeInternalIP, Address: "127.100.100.1"})) + Expect(addresses).ShouldNot(ContainElement(v1.NodeAddress{Type: v1.NodeInternalIP, Address: "127.200.200.1"})) }) })