summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-11-27 03:29:07 -0800
committerGitHub <noreply@github.com>2018-11-27 03:29:07 -0800
commit1d3e24239aa525640bcc9cef4864fb04d69143ed (patch)
treef159f155d93f73320a604d89d68f010397db72cb /cmd/podman
parent39560500fcc504bea70d48759f44c64f680c2ef2 (diff)
parentbb6c1cf8d1667c7c8e4d539ea2250a18fa89a58a (diff)
downloadpodman-1d3e24239aa525640bcc9cef4864fb04d69143ed.tar.gz
podman-1d3e24239aa525640bcc9cef4864fb04d69143ed.tar.bz2
podman-1d3e24239aa525640bcc9cef4864fb04d69143ed.zip
Merge pull request #1734 from rhatdan/network
libpod should know if the network is disabled
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/create.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/podman/create.go b/cmd/podman/create.go
index 9f6825c95..bcf830c7c 100644
--- a/cmd/podman/create.go
+++ b/cmd/podman/create.go
@@ -670,6 +670,11 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim
if util.StringInSlice(".", c.StringSlice("dns-search")) && len(c.StringSlice("dns-search")) > 1 {
return nil, errors.Errorf("cannot pass additional search domains when also specifying '.'")
}
+ if !netMode.IsPrivate() {
+ if c.IsSet("dns-search") || c.IsSet("dns") || c.IsSet("dns-opt") {
+ return nil, errors.Errorf("specifying DNS flags when network mode is shared with the host or another container is not allowed")
+ }
+ }
// Validate domains are good
for _, dom := range c.StringSlice("dns-search") {