mirror of
https://github.com/containers/podman.git
synced 2025-06-27 21:50:18 +08:00
Merge pull request #11761 from umohnani8/init
Add port configuration to first regular container
This commit is contained in:
@ -253,7 +253,9 @@ func (p *Pod) podWithContainers(ctx context.Context, containers []*Container, po
|
||||
// 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.
|
||||
if first && len(ports) > 0 {
|
||||
// Add the port configuration to the first regular container or the first
|
||||
// init container if only init containers have been created in the pod.
|
||||
if first && len(ports) > 0 && (!isInit || len(containers) == 2) {
|
||||
ctr.Ports = ports
|
||||
first = false
|
||||
}
|
||||
|
Reference in New Issue
Block a user