aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2020-04-27 12:57:09 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2020-04-27 12:58:02 +0200
commitadb10783d9117bbbb8311079b26a08b8c3bd0b64 (patch)
tree128ec99feeea3a62a52ad25cec180c7eace5a053 /pkg
parent408d1328e22182830a15b8c462ec8652a42ef74a (diff)
downloadpodman-adb10783d9117bbbb8311079b26a08b8c3bd0b64.tar.gz
podman-adb10783d9117bbbb8311079b26a08b8c3bd0b64.tar.bz2
podman-adb10783d9117bbbb8311079b26a08b8c3bd0b64.zip
spec, pod: honor --dns
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/specgen/generate/pod_create.go7
1 files changed, 7 insertions, 0 deletions
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))
}