diff options
author | Vadim Rutkovsky <vrutkovs@redhat.com> | 2018-02-12 11:49:55 +0100 |
---|---|---|
committer | Vadim Rutkovsky <vrutkovs@redhat.com> | 2018-02-12 12:35:14 +0100 |
commit | 29bd49e4586d73442e5deab53bc02e27eedb0c86 (patch) | |
tree | 96049fb61f80e0f8b18dbccb2c175b174870642d /roles/openshift_node/files | |
parent | f18cfa7897d771cb973b9aa28a90bc3575b56f58 (diff) | |
download | openshift-29bd49e4586d73442e5deab53bc02e27eedb0c86.tar.gz openshift-29bd49e4586d73442e5deab53bc02e27eedb0c86.tar.bz2 openshift-29bd49e4586d73442e5deab53bc02e27eedb0c86.tar.xz openshift-29bd49e4586d73442e5deab53bc02e27eedb0c86.zip |
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
Diffstat (limited to 'roles/openshift_node/files')
-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 |