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>
This commit is contained in:
Matthew Heon 2019-03-22 14:52:56 -04:00
parent 72f03f0c25
commit 16a7c7ff82

View file

@ -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))