mirror of
https://github.com/containers/podman.git
synced 2025-06-21 09:28:09 +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 {
|
if err != nil {
|
||||||
return nil, err
|
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
|
// We add the original port declarations from the libpod infra container
|
||||||
// to the first kubernetes container description because otherwise we loose
|
// to the first kubernetes container description because otherwise we loose
|
||||||
// the original container/port bindings.
|
// the original container/port bindings.
|
||||||
|
Reference in New Issue
Block a user