From adb10783d9117bbbb8311079b26a08b8c3bd0b64 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Mon, 27 Apr 2020 12:57:09 +0200 Subject: spec, pod: honor --dns Signed-off-by: Giuseppe Scrivano --- pkg/specgen/generate/pod_create.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pkg/specgen/generate') diff --git a/pkg/specgen/generate/pod_create.go b/pkg/specgen/generate/pod_create.go index 292f9b155..babfba9bc 100644 --- a/pkg/specgen/generate/pod_create.go +++ b/pkg/specgen/generate/pod_create.go @@ -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)) } -- cgit v1.2.3-54-g00ecf