summaryrefslogtreecommitdiff
path: root/cmd/podman/create.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-01-16 17:07:56 +0100
committerGitHub <noreply@github.com>2020-01-16 17:07:56 +0100
commit1d7176b135fab2da4800b11f91b912963aa0288b (patch)
treef7cbc5cfe8423fe6998fd51783d0db159533cbbc /cmd/podman/create.go
parentdb00ee97e950290a6bc5d669cde0cbc54bb94afe (diff)
parent45e9a6b12e74d50b8f6ab271c7800cb165f451e4 (diff)
downloadpodman-1d7176b135fab2da4800b11f91b912963aa0288b.tar.gz
podman-1d7176b135fab2da4800b11f91b912963aa0288b.tar.bz2
podman-1d7176b135fab2da4800b11f91b912963aa0288b.zip
Merge pull request #4869 from rhatdan/network
Remove c.String(net)
Diffstat (limited to 'cmd/podman/create.go')
-rw-r--r--cmd/podman/create.go8
1 files changed, 1 insertions, 7 deletions
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.")
}