spec, pod: honor --dns

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano
2020-04-27 12:57:09 +02:00
parent 408d1328e2
commit adb10783d9

View File

@ -46,6 +46,13 @@ func createPodOptions(p *specgen.PodSpecGenerator) ([]libpod.PodCreateOption, er
if len(p.HostAdd) > 0 {
options = append(options, libpod.WithPodHosts(p.HostAdd))
}
if len(p.DNSServer) > 0 {
var dnsServers []string
for _, d := range p.DNSServer {
dnsServers = append(dnsServers, d.String())
}
options = append(options, libpod.WithPodDNS(dnsServers))
}
if len(p.DNSOption) > 0 {
options = append(options, libpod.WithPodDNSOption(p.DNSOption))
}