kubenet: Fix host port for rktnetes.

Because rkt pod runs after plugin.SetUpPod() is called, so
getRunningPods() does not return the newly created pod, which
causes the hostport iptable rules to be missing for this new pod.
This commit is contained in:
Yifan Gu
2016-06-22 17:52:12 -07:00
parent db43b68640
commit 9140ce07bc
4 changed files with 21 additions and 8 deletions

View File

@@ -185,7 +185,7 @@ func TestOpenPodHostports(t *testing.T) {
})
}
err := h.OpenPodHostportsAndSync(tests[0].pod, "br0", runningPods)
err := h.OpenPodHostportsAndSync(&RunningPod{Pod: tests[0].pod, IP: net.ParseIP(tests[0].ip)}, "br0", runningPods)
if err != nil {
t.Fatalf("Failed to OpenPodHostportsAndSync: %v", err)
}