diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-01-15 14:36:20 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-01-16 14:58:06 +0000 |
commit | 4d70a6997c40790239138e27994fc803609ca4ec (patch) | |
tree | 7cc04d82f099736a3cc548e3ea667d6eb08adeb2 /cmd/podman | |
parent | 3cd647ccf62be30c3e9fc134c512260e123b7953 (diff) | |
download | podman-4d70a6997c40790239138e27994fc803609ca4ec.tar.gz podman-4d70a6997c40790239138e27994fc803609ca4ec.tar.bz2 podman-4d70a6997c40790239138e27994fc803609ca4ec.zip |
Minor change to --net parsing
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Closes: #220
Approved by: rhatdan
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/spec.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/podman/spec.go b/cmd/podman/spec.go index 35c6ef130..df1c54d50 100644 --- a/cmd/podman/spec.go +++ b/cmd/podman/spec.go @@ -545,15 +545,15 @@ func (c *createConfig) GetContainerCreateOptions() ([]libpod.CtrCreateOption, er options = append(options, libpod.WithName(c.Name)) } // TODO parse ports into libpod format and include - if !c.NetMode.IsHost() && !c.NetMode.IsContainer() { - options = append(options, libpod.WithNetNS([]ocicni.PortMapping{})) - } else if c.NetMode.IsContainer() { + if c.NetMode.IsContainer() { connectedCtr, err := c.Runtime.LookupContainer(c.NetMode.ConnectedContainer()) if err != nil { return nil, errors.Wrapf(err, "container %q not found", c.NetMode.ConnectedContainer()) } options = append(options, libpod.WithNetNSFrom(connectedCtr)) + } else if !c.NetMode.IsHost() { + options = append(options, libpod.WithNetNS([]ocicni.PortMapping{})) } if c.PidMode.IsContainer() { connectedCtr, err := c.Runtime.LookupContainer(c.PidMode.Container()) |