From 45e9a6b12e74d50b8f6ab271c7800cb165f451e4 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Tue, 14 Jan 2020 18:55:20 -0500 Subject: Remove c.String(net) We have a lot of cludgy code trying to make --net and --network equivalent. This will allow --net to still exists but will eliminate the help and confusion. Signed-off-by: Daniel J Walsh --- cmd/podman/create.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'cmd/podman/create.go') diff --git a/cmd/podman/create.go b/cmd/podman/create.go index 73fba5a8c..01cad9765 100644 --- a/cmd/podman/create.go +++ b/cmd/podman/create.go @@ -85,13 +85,7 @@ func createInit(c *cliconfig.PodmanCommand) error { logrus.Warn("setting security options with --privileged has no effect") } - var setNet string - if c.IsSet("network") { - setNet = c.String("network") - } else if c.IsSet("net") { - setNet = c.String("net") - } - if (c.IsSet("dns") || c.IsSet("dns-opt") || c.IsSet("dns-search")) && (setNet == "none" || strings.HasPrefix(setNet, "container:")) { + if (c.IsSet("dns") || c.IsSet("dns-opt") || c.IsSet("dns-search")) && (c.String("network") == "none" || strings.HasPrefix(c.String("network"), "container:")) { return errors.Errorf("conflicting options: dns and the network mode.") } -- cgit v1.2.3-54-g00ecf