diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-02-12 13:18:18 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-12 13:18:18 -0800 |
commit | 1c9c93d616da65d6121fd34fe0258b45ba909cb8 (patch) | |
tree | 62d9bb449915cc60e449ba53bbc4c1bcf33d1b8d | |
parent | e2b4f9d521b858d69a5ae9fd57b762532cd10b92 (diff) | |
parent | 29bd49e4586d73442e5deab53bc02e27eedb0c86 (diff) | |
download | openshift-1c9c93d616da65d6121fd34fe0258b45ba909cb8.tar.gz openshift-1c9c93d616da65d6121fd34fe0258b45ba909cb8.tar.bz2 openshift-1c9c93d616da65d6121fd34fe0258b45ba909cb8.tar.xz openshift-1c9c93d616da65d6121fd34fe0258b45ba909cb8.zip |
Merge pull request #7103 from vrutkovs/origin-dns-prepend-cluster-local
Automatic merge from submit-queue.
origin-dns: make sure cluster.local DNS server is listed first
This would ensure glibc resolver won't discard this server when existing
DNS server list is longer than 2.
This sed would also update existing configuration, where cluster.local
was appended
Fixes bug https://bugzilla.redhat.com/show_bug.cgi?id=1544001
-rwxr-xr-x | roles/openshift_node/files/networkmanager/99-origin-dns.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/roles/openshift_node/files/networkmanager/99-origin-dns.sh b/roles/openshift_node/files/networkmanager/99-origin-dns.sh index f4e48b5b7..acf3e2f38 100755 --- a/roles/openshift_node/files/networkmanager/99-origin-dns.sh +++ b/roles/openshift_node/files/networkmanager/99-origin-dns.sh @@ -116,8 +116,9 @@ EOF echo "nameserver "${def_route_ip}"" >> ${NEW_RESOLV_CONF} if ! grep -qw search ${NEW_RESOLV_CONF}; then echo 'search cluster.local' >> ${NEW_RESOLV_CONF} - elif ! grep -q 'search.*cluster.local' ${NEW_RESOLV_CONF}; then - sed -i '/^search/ s/$/ cluster.local/' ${NEW_RESOLV_CONF} + elif ! grep -q 'search cluster.local' ${NEW_RESOLV_CONF}; then + # cluster.local should be in first three DNS names so that glibc resolver would work + sed -i -e 's/^search \(.\+\)\( cluster\.local\)\{0,1\}$/search cluster.local \1/' ${NEW_RESOLV_CONF} fi cp -Z ${NEW_RESOLV_CONF} /etc/resolv.conf fi |