xds: replace net with netip in xds/xdsclient and xds/server#8909
xds: replace net with netip in xds/xdsclient and xds/server#8909easwars merged 7 commits intogrpc:masterfrom
xds/xdsclient and xds/server#8909Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8909 +/- ##
==========================================
+ Coverage 83.04% 83.06% +0.02%
==========================================
Files 411 411
Lines 32892 32893 +1
==========================================
+ Hits 27316 27324 +8
+ Misses 4181 4179 -2
+ Partials 1395 1390 -5
🚀 New features to boost your workflow:
|
f6044c3 to
3ab95f0
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
The pull request successfully transitions the xDS client and server components from using net.IP and net.IPNet to the more efficient netip.Addr and netip.Prefix. This is a positive change for performance and memory usage. I have identified one important issue in listener_wrapper.go where incoming addresses should be normalized using .Unmap() to ensure consistent matching against stored prefixes, especially since the stored prefixes are normalized during unmarshaling in unmarshal_lds.go.
|
Since the approach was verbose and duplicated across Ready for review. |
Contributes to #8884 This PR replaces deprecated `net.IP` usage with the modern `netip.Addr` API in two packages: - **grpclb**: Replace `net.IP(s.IpAddress).String()` with `netip.AddrFromSlice()` in `processServerList`, adding proper error handling for invalid IP addresses instead of silently producing `"?"` from `net.IP.String()`. Note: `x509.Certificate.IPAddresses` fields in test files (`internal/credentials/xds/handshake_info_test.go`, `security/advancedtls/crl_test.go`) are typed as `[]net.IP` by the standard library, so those cannot be migrated. The xds/server and xds/xdsclient packages are being addressed in #8909. RELEASE NOTES: N/A
Removed unused 'net' import from filter_chain_manager_test.go
|
conflicts solved, sorry for the delay. |
Updates #8884
This PR replace
net.IPandnet.IPNetwithnetip.Addrandnetip.Prefixin directoriesinternal/xds/xdsclientandinternal/xds/serverRELEASE NOTES:
addFilterChainsForDestPrefixesandaddFilterChainsForSourcePrefixeswhen an invalid prefix or address is encountered.