Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add valid search when search does not exist on resolv.conf #5585

Merged
merged 1 commit into from
Oct 10, 2017
Merged

Conversation

nak3
Copy link
Contributor

@nak3 nak3 commented Sep 29, 2017

Current fix #5433 still misses to add search cluster.local. The logic needs to be:

  1. When search does not exist, adds search cluster.local.
  2. When search.*.cluster.local does not exist, adds(sed) cluster.local.

in this order.

cc @sdodson @caruccio

@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 29, 2017
@nak3
Copy link
Contributor Author

nak3 commented Sep 29, 2017

Here is a test script to confirm current bug for saving your time. This will not add search cluster.local.

test.sh

NEW_RESOLV_CONF=resolv.conf

# current script
if ! grep -q 'search.*cluster.local' ${NEW_RESOLV_CONF}; then
	sed -i '/^search/ s/$/ cluster.local/' ${NEW_RESOLV_CONF}
elif ! grep -qw search ${NEW_RESOLV_CONF}; then
        echo 'search cluster.local' >> ${NEW_RESOLV_CONF}
fi

## fixed script
#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}
#fi

resolv.conf

# Generated by NetworkManager
nameserver 192.168.122.1

@ingvagabund
Copy link
Member

/retest

@sdodson
Copy link
Member

sdodson commented Oct 10, 2017

/kind bug
/lgtm

@openshift-ci-robot openshift-ci-robot added kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. labels Oct 10, 2017
@openshift-merge-robot
Copy link
Contributor

/test all [submit-queue is verifying that this PR is safe to merge]

@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue.

@openshift-merge-robot openshift-merge-robot merged commit 4812615 into openshift:master Oct 10, 2017
@nak3 nak3 deleted the bz#1496593 branch December 29, 2017 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_3.6 kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants