diff options
author | baude <bbaude@redhat.com> | 2018-02-06 19:52:42 -0600 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-02-09 16:13:20 +0000 |
commit | a8092a105b493f3c7f9ee063aa2ca035bc7f9be8 (patch) | |
tree | 26678f4ce2991052ad81ecd60d7587be9fdb2caf /cmd/podman/spec.go | |
parent | fa9658cbfaa94fd5d0425041404e498c01db1aa3 (diff) | |
download | podman-a8092a105b493f3c7f9ee063aa2ca035bc7f9be8.tar.gz podman-a8092a105b493f3c7f9ee063aa2ca035bc7f9be8.tar.bz2 podman-a8092a105b493f3c7f9ee063aa2ca035bc7f9be8.zip |
Rework port code
Rework port code for generalized clean up and to address
issue #269 where additional portbindings between host
and containers we being introduced by error.
Signed-off-by: baude <bbaude@redhat.com>
Closes: #308
Approved by: mheon
Diffstat (limited to 'cmd/podman/spec.go')
-rw-r--r-- | cmd/podman/spec.go | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/cmd/podman/spec.go b/cmd/podman/spec.go index 56e8c8d05..5206a4d36 100644 --- a/cmd/podman/spec.go +++ b/cmd/podman/spec.go @@ -570,8 +570,7 @@ func (c *createConfig) GetContainerCreateOptions() ([]libpod.CtrCreateOption, er options = append(options, libpod.WithName(c.Name)) } - // TODO deal with ports defined in image metadata - if len(c.PortBindings) > 0 || len(c.ExposedPorts) > 0 { + if len(c.PortBindings) > 0 { portBindings, err = c.CreatePortBindings() if err != nil { return nil, errors.Wrapf(err, "unable to create port bindings") @@ -679,15 +678,5 @@ func (c *createConfig) CreatePortBindings() ([]ocicni.PortMapping, error) { portBindings = append(portBindings, pm) } } - for j := range c.ExposedPorts { - var expose ocicni.PortMapping - expose.HostPort = int32(j.Int()) - expose.ContainerPort = int32(j.Int()) - // CNI requires us to make both udp and tcp structs - expose.Protocol = "udp" - portBindings = append(portBindings, expose) - expose.Protocol = "tcp" - portBindings = append(portBindings, expose) - } return portBindings, nil } |