summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-06-24 14:25:37 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-06-24 14:27:47 -0400
commitebf48ff45991363a05a7f84225a415dbaaa85e80 (patch)
tree2b4807d26a4e09b03f66c3659d957b3a59476efd /libpod
parenta1a4a75abee2c381483a218e1660621ee416ef7c (diff)
downloadpodman-ebf48ff45991363a05a7f84225a415dbaaa85e80.tar.gz
podman-ebf48ff45991363a05a7f84225a415dbaaa85e80.tar.bz2
podman-ebf48ff45991363a05a7f84225a415dbaaa85e80.zip
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 <matthew.heon@pm.me>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/kube.go5
1 files changed, 5 insertions, 0 deletions
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.