mirror of
https://github.com/containers/podman.git
synced 2025-06-01 17:17:47 +08:00
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>
This commit is contained in:
@ -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.
|
||||
|
Reference in New Issue
Block a user