diff --git a/calico_cni_test.go b/calico_cni_test.go index 138d35385..78c7d9669 100644 --- a/calico_cni_test.go +++ b/calico_cni_test.go @@ -390,65 +390,4 @@ var _ = Describe("CalicoCni", func() { }) }) }) - - Describe("CNI should be resilient to an already existing route", func() { - Context("add a new container when the route already exists ", func() { - netconf := fmt.Sprintf(` - { - "cniVersion": "%s", - "name": "net1", - "type": "calico", - "etcd_endpoints": "http://%s:2379", - "ipam": { - "type": "host-local", - "subnet": "10.0.0.0/24" - } - }`, cniVersion, os.Getenv("ETCD_IP")) - - It("should successfully add and network the container", func() { - containerIPStr := "10.0.0.55" - _, containerIP, _ := net.ParseCIDR("10.0.0.55/32") - - By("Manually programming the route that CNI plugin is going to add.") - err := netlink.RouteAdd( - &netlink.Route{ - Scope: netlink.SCOPE_LINK, - Dst: containerIP, - }) - - log.Printf("*** error: %v", err) - // Expect(err).ShouldNot(HaveOccurred()) - By("Calling the CNI plugin requesting the same IP, so CNI would try to add the same route.") - containerID, session, _, _, _, contNs, err := CreateContainer(netconf, "", containerIPStr) - Expect(err).ShouldNot(HaveOccurred()) - Eventually(session).Should(gexec.Exit()) - - result, err := GetResultForCurrent(session, cniVersion) - if err != nil { - log.Fatalf("Error getting result from the session: %v\n", err) - } - - log.Printf("Unmarshalled result from first ADD: %v\n", result) - - // The endpoint should be created in the backend - endpoints, err := calicoClient.WorkloadEndpoints().List(api.WorkloadEndpointMetadata{}) - Expect(err).ShouldNot(HaveOccurred()) - Expect(endpoints.Items).Should(HaveLen(1)) - - // Set the Revision to nil since we can't assert it's exact value. - endpoints.Items[0].Metadata.Revision = nil - Expect(endpoints.Items[0].Metadata).Should(Equal(api.WorkloadEndpointMetadata{ - Node: hostname, - Name: "eth0", - Workload: containerID, - ActiveInstanceID: "", - Orchestrator: "cni", - })) - - By("Deleting the container we created.") - _, err = DeleteContainer(netconf, contNs.Path(), "") - Expect(err).To(HaveOccurred()) - }) - }) - }) }) diff --git a/utils/network.go b/utils/network.go index 25ab44d5f..f35b1d3ff 100644 --- a/utils/network.go +++ b/utils/network.go @@ -239,7 +239,6 @@ func setupRoutes(hostVeth netlink.Link, result *current.Result) error { } log.Debugf("CNI adding route for interface: %v, IP: %s", hostVeth, ipAddr.Address) - log.Warningf("********* CNI adding route %#v for interface: %v, IP: %s, Index: %d\n", route, hostVeth, ipAddr.Address, hostVeth.Attrs().Index) } return nil }