From 4b33f0d393b0e2e790550dd6f33516ac06419c3b Mon Sep 17 00:00:00 2001 From: Arjun Baindur Date: Mon, 20 Sep 2021 21:18:58 -0700 Subject: [PATCH] ip-reconciler: Add all non default interfaces to Pod IP list --- pkg/reconciler/wrappedPod.go | 7 +++---- pkg/reconciler/wrappedPod_test.go | 17 ----------------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/pkg/reconciler/wrappedPod.go b/pkg/reconciler/wrappedPod.go index 5ade3a2f4..bcedddf87 100644 --- a/pkg/reconciler/wrappedPod.go +++ b/pkg/reconciler/wrappedPod.go @@ -71,10 +71,9 @@ func getFlatIPSet(pod v1.Pod) map[string]void { continue } - if network.Interface[:multusPrefixSize] == multusInterfaceNamePrefix { - for _, ip := range network.IPs { - ipSet[ip] = empty - } + for _, ip := range network.IPs { + ipSet[ip] = empty + logging.Debugf("Added IP %s for pod %s", ip, composePodRef(pod)) } } return ipSet diff --git a/pkg/reconciler/wrappedPod_test.go b/pkg/reconciler/wrappedPod_test.go index 04d7f8c90..79d9afd93 100644 --- a/pkg/reconciler/wrappedPod_test.go +++ b/pkg/reconciler/wrappedPod_test.go @@ -114,23 +114,6 @@ var _ = Describe("Pod Wrapper operations", func() { Expect(podSecondaryIPs).To(Equal(map[string]void{"192.168.14.14": {}, "10.10.10.10": {}})) }) - It("should filter out non-multus annotations", func() { - secondaryIfacesNetworkStatuses := generateMultusNetworkStatusList("192.168.14.14", "10.10.10.10") - - networkStatus := append( - secondaryIfacesNetworkStatuses, - generateMultusNetworkStatus("eth0", "network33", "14.15.16.20")) - pod := v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Annotations: generateMultusNetworkStatusAnnotationFromNetworkStatus(networkStatus...), - }, - } - - podSecondaryIPs := wrapPod(pod).ips - Expect(podSecondaryIPs).To(HaveLen(2)) - Expect(podSecondaryIPs).To(Equal(map[string]void{"192.168.14.14": {}, "10.10.10.10": {}})) - }) - It("return an empty list when the network annotations of a pod are invalid", func() { pod := v1.Pod{ ObjectMeta: metav1.ObjectMeta{