aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-02-01 15:58:27 -0500
committerMatthew Heon <matthew.heon@pm.me>2022-02-03 16:21:26 -0500
commit48f10e1d0d5873c7baa0613156294307f8c9942d (patch)
treeb750ce0e49a68f2282b7bdb602334e2696087cdd /pkg
parent938d5152ca6a2e347cd62aaba25c178fd077a235 (diff)
downloadpodman-48f10e1d0d5873c7baa0613156294307f8c9942d.tar.gz
podman-48f10e1d0d5873c7baa0613156294307f8c9942d.tar.bz2
podman-48f10e1d0d5873c7baa0613156294307f8c9942d.zip
Move each search dns to its own line
Alpine does not seem to use search correctly when there are multiple search domains on the same line. It only uses the first with the advent. When podman runs within a separate network we are appending on dns.podman as a search, if you add a search domain, then this causes the local search on network to fail. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/resolvconf/resolvconf.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/pkg/resolvconf/resolvconf.go b/pkg/resolvconf/resolvconf.go
index f23cd61b0..d7505e049 100644
--- a/pkg/resolvconf/resolvconf.go
+++ b/pkg/resolvconf/resolvconf.go
@@ -221,11 +221,9 @@ func GetOptions(resolvConf []byte) []string {
// dnsSearch, and an "options" entry for every element in dnsOptions.
func Build(path string, dns, dnsSearch, dnsOptions []string) (*File, error) {
content := bytes.NewBuffer(nil)
- if len(dnsSearch) > 0 {
- if searchString := strings.Join(dnsSearch, " "); strings.Trim(searchString, " ") != "." {
- if _, err := content.WriteString("search " + searchString + "\n"); err != nil {
- return nil, err
- }
+ for _, search := range dnsSearch {
+ if _, err := content.WriteString("search " + search + "\n"); err != nil {
+ return nil, err
}
}
for _, dns := range dns {