Skip to content

Commit

Permalink
Merge pull request #11761 from umohnani8/init
Browse files Browse the repository at this point in the history
Add port configuration to first regular container
  • Loading branch information
openshift-merge-robot authored Sep 29, 2021
2 parents 512a994 + a3cdee9 commit a22a9a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libpod/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit a22a9a5

Please sign in to comment.