From 4d70a6997c40790239138e27994fc803609ca4ec Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Mon, 15 Jan 2018 14:36:20 -0500 Subject: Minor change to --net parsing Signed-off-by: Matthew Heon Closes: #220 Approved by: rhatdan --- cmd/podman/spec.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd/podman/spec.go') 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()) -- cgit v1.2.3-54-g00ecf