diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-02-02 12:35:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-02 12:35:30 -0500 |
commit | 21a8ee904465b1aa54ce5fa6e3bbf93519ca0442 (patch) | |
tree | 21ad9581701bea877c3db583c31b86d6df70572d /pkg | |
parent | 2739b3ca85ad5d315acbbe17129d35223c8e2b55 (diff) | |
parent | a1bc8cb52cefd49e8cc54ae14d1864b8a1ec216e (diff) | |
download | podman-21a8ee904465b1aa54ce5fa6e3bbf93519ca0442.tar.gz podman-21a8ee904465b1aa54ce5fa6e3bbf93519ca0442.tar.bz2 podman-21a8ee904465b1aa54ce5fa6e3bbf93519ca0442.zip |
Merge pull request #13089 from rhatdan/resolv.conf
Only change network fields if they were actually changed by the user
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/resolvconf/resolvconf.go | 8 |
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 { |