From ebf48ff45991363a05a7f84225a415dbaaa85e80 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Mon, 24 Jun 2019 14:25:37 -0400 Subject: Only include ports in one container in Kube YAML This likely broke when we made containers able to detect that they shared a network namespace and grab ports from the dependency container - prior to that, we could grab ports without concern for conflict, only the infra container had them. Now, all containers in a pod will return the same ports, so we have to work around this. Fixes #3408 Signed-off-by: Matthew Heon --- libpod/kube.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libpod') diff --git a/libpod/kube.go b/libpod/kube.go index c5fd9d75c..283662059 100644 --- a/libpod/kube.go +++ b/libpod/kube.go @@ -138,6 +138,11 @@ func (p *Pod) podWithContainers(containers []*Container, ports []v1.ContainerPor if err != nil { return nil, err } + + // Since port bindings for the pod are handled by the + // infra container, wipe them here. + result.Ports = nil + // We add the original port declarations from the libpod infra container // to the first kubernetes container description because otherwise we loose // the original container/port bindings. -- cgit v1.2.3-54-g00ecf