Skip to content

Commit

Permalink
hostveth index
Browse files Browse the repository at this point in the history
  • Loading branch information
gunjan5 committed Sep 24, 2017
1 parent 5aefc3e commit f19710a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions calico_cni_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,12 +410,14 @@ var _ = Describe("CalicoCni", func() {
_, containerIP, _ := net.ParseCIDR("10.0.0.55/32")

By("Manually programming the route that CNI plugin is going to add.")
netlink.RouteAdd(
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())
Expand Down Expand Up @@ -445,7 +447,7 @@ var _ = Describe("CalicoCni", func() {

By("Deleting the container we created.")
_, err = DeleteContainer(netconf, contNs.Path(), "")
Expect(err).ShouldNot(HaveOccurred())
Expect(err).To(HaveOccurred())
})
})
})
Expand Down
1 change: 1 addition & 0 deletions utils/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ 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
}
Expand Down

0 comments on commit f19710a

Please sign in to comment.