Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix duplicate prepender entries in resolv.conf
In #2835, we changed how the prepender finds the location to insert the prepended nameserver. Unfortunately, this caused it to prepend the nameserver before each existing nameserver line, which results in duplicate entries for the local nameserver. For example: search ostest.test.metalkube.org nameserver 192.168.111.23 nameserver 8.8.8.8 nameserver 192.168.111.23 This is mildly problematic since it pushes the second nameserver out of the list of 3 that are allowed. In general this probably won't cause problems because only the local nameserver is actually used, but it looks weird and will almost certainly result in a bug report from customers at some point. The replacement sed line is stolen from [0] and is specific to GNU sed, but that shouldn't be a problem for us since we only use that version of sed. 0: https://stackoverflow.com/questions/9970124/sed-to-insert-on-first-match-only (cherry picked from commit 88713b7)
- Loading branch information