diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-12-04 07:49:06 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-04 07:49:06 -0800 |
commit | 6c060b1ca45bfb96c71e7f2114f1f31f53d0084b (patch) | |
tree | e53e04da83ac3c4def3118025f50e35fc836f83f /pkg | |
parent | 5f6ad82524ca7a3281c8464c84b4f9be4ff90aef (diff) | |
parent | 9c359a31d542074ff686a2f9ad29deee73e92d79 (diff) | |
download | podman-6c060b1ca45bfb96c71e7f2114f1f31f53d0084b.tar.gz podman-6c060b1ca45bfb96c71e7f2114f1f31f53d0084b.tar.bz2 podman-6c060b1ca45bfb96c71e7f2114f1f31f53d0084b.zip |
Merge pull request #1907 from baude/createpodautomatically
create pod on the fly
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/spec/createconfig.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/spec/createconfig.go b/pkg/spec/createconfig.go index a0fd40318..25f8cd7a1 100644 --- a/pkg/spec/createconfig.go +++ b/pkg/spec/createconfig.go @@ -496,8 +496,13 @@ func (c *CreateConfig) GetContainerCreateOptions(runtime *libpod.Runtime) ([]lib // CreatePortBindings iterates ports mappings and exposed ports into a format CNI understands func (c *CreateConfig) CreatePortBindings() ([]ocicni.PortMapping, error) { + return NatToOCIPortBindings(c.PortBindings) +} + +// NatToOCIPortBindings iterates a nat.portmap slice and creates []ocicni portmapping slice +func NatToOCIPortBindings(ports nat.PortMap) ([]ocicni.PortMapping, error) { var portBindings []ocicni.PortMapping - for containerPb, hostPb := range c.PortBindings { + for containerPb, hostPb := range ports { var pm ocicni.PortMapping pm.ContainerPort = int32(containerPb.Int()) for _, i := range hostPb { |