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
Be more accuracy for getting def_route_int and def_route_ip #9448
Conversation
Can one of the admins verify this patch?
|
@@ -44,8 +44,8 @@ if [[ $2 =~ ^(up|dhcp4-change|dhcp6-change)$ ]]; then | |||
# couldn't find an existing method to determine if the interface owns the | |||
# default route | |||
def_route=$(/sbin/ip route list match 0.0.0.0/0 | awk '{print $3 }') | |||
def_route_int=$(/sbin/ip route get to ${def_route} | awk '{print $3}') | |||
def_route_ip=$(/sbin/ip route get to ${def_route} | awk '{print $5}') | |||
def_route_int=$(/sbin/ip route get to ${def_route} | awk -F 'dev' '{print $2}' | awk '{print $1}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems suitable, let's pipe the output of each ip command to head -n1 before awk to filter out cache line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaelgugino Thank you for your point. You're right. It include the new line, so head -n1 can remove it. I've updated.
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bysnupy, michaelgugino The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@bysnupy: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/cherrypick release-3.10 /cherrypick release-3.9 /cherrypick release-3.7 |
@michaelgugino: new pull request created: #9484 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Fix the BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1613094
If the
ip command
output is unexpected order, it can cause the issues about DNS due to pointing upstream DNS in theresolv.conf
.For suppressing issues due to dependence of output order, we should filter to get required values.