-
Notifications
You must be signed in to change notification settings - Fork 370
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
Optimize getting routes function for Windows #5335
Optimize getting routes function for Windows #5335
Conversation
e79c30a
to
c1ced70
Compare
c1ced70
to
ce96c68
Compare
pkg/agent/util/net_windows.go
Outdated
@@ -1296,3 +1290,16 @@ func adapterAddresses() ([]*windows.IpAdapterAddresses, error) { | |||
} | |||
return aas, nil | |||
} | |||
|
|||
// ipNetEqual returns true iff both IPNet are equal | |||
func ipNetEqual(ipn1 *net.IPNet, ipn2 *net.IPNet) bool { |
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.
can we use IPNetEqual
defined in pkg/util/ip/ip.go
?
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.
We can use IPNetEqual
in pkg/util/ip/ip.go
in this PR, but in #5159, we might still need this.
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.
Sorry, maybe I am missing some context. Aren't the 2 supposed to do the same thing?
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.
I'll verify that. I remember that when I made some tests in #5159, IPNetEqual
in pkg/util/ip/ip.go
cannot be called by the unit tests for Windows code.
@@ -623,17 +623,6 @@ func TestReplaceNetRoute(t *testing.T) { | |||
} | |||
} | |||
|
|||
func TestGetNetRoutesAll(t *testing.T) { |
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.
should there be a replacement test for RouteListFiltered
?
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.
Will add the unit test in #5159
ce96c68
to
759c5d2
Compare
759c5d2
to
d697bd5
Compare
/test-all |
Signed-off-by: Hongliang Liu <[email protected]>
d697bd5
to
9706df0
Compare
/test-all |
Signed-off-by: Hongliang Liu <[email protected]>
Signed-off-by: Hongliang Liu <[email protected]>
No description provided.