mirror of
https://github.com/containers/podman.git
synced 2025-10-19 20:23:08 +08:00
Merge pull request #2416 from rhatdan/network
Allow dns settings with --net=host
This commit is contained in:
@ -646,11 +646,6 @@ func parseCreateOpts(ctx context.Context, c *cliconfig.PodmanCommand, runtime *l
|
|||||||
if util.StringInSlice(".", c.StringSlice("dns-search")) && len(c.StringSlice("dns-search")) > 1 {
|
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 '.'")
|
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
|
// Validate domains are good
|
||||||
for _, dom := range c.StringSlice("dns-search") {
|
for _, dom := range c.StringSlice("dns-search") {
|
||||||
|
Reference in New Issue
Block a user