diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-03-22 14:52:56 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-03-27 10:12:18 -0400 |
commit | 16a7c7ff82e53bb29d03d816ffa53ae4ae29e86f (patch) | |
tree | 2c721e186397037ca08d16f7bfb544faee53609a /pkg/spec/createconfig.go | |
parent | 72f03f0c2587be4ff3ff9c83d28964cc7c1a135c (diff) | |
download | podman-16a7c7ff82e53bb29d03d816ffa53ae4ae29e86f.tar.gz podman-16a7c7ff82e53bb29d03d816ffa53ae4ae29e86f.tar.bz2 podman-16a7c7ff82e53bb29d03d816ffa53ae4ae29e86f.zip |
Add for --dns=none to disable creation of resolv.conf
Support in libpod was added in the previous commit. Wire it into
the frontend here.
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'pkg/spec/createconfig.go')
-rw-r--r-- | pkg/spec/createconfig.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/spec/createconfig.go b/pkg/spec/createconfig.go index 118fbad72..fba69d1ba 100644 --- a/pkg/spec/createconfig.go +++ b/pkg/spec/createconfig.go @@ -505,7 +505,11 @@ func (c *CreateConfig) GetContainerCreateOptions(runtime *libpod.Runtime, pod *l options = append(options, libpod.WithDNSSearch(c.DNSSearch)) } if len(c.DNSServers) > 0 { - options = append(options, libpod.WithDNS(c.DNSServers)) + if len(c.DNSServers) == 1 && c.DNSServers[0] == "none" { + options = append(options, libpod.WithNoCreateResolvConf()) + } else { + options = append(options, libpod.WithDNS(c.DNSServers)) + } } if len(c.DNSOpt) > 0 { options = append(options, libpod.WithDNSOption(c.DNSOpt)) |