NetworkInfo support for IPv6 and dual stack#1432
Open
poojav25 wants to merge 2 commits into
Open
Conversation
…nd AVI The LoadBalancerBackendIPs field was declared in VPCState but never populated. This change wires it up for all three LB paths: - NSX LB non-TEP-less: read all IPs from ExtendedAttributes["IpAddresses"].Values on the realized interface via new GetPolicyInterfaceIPs helper (both IPv4+IPv6). - NSX LB TEP-less: best-effort fetch of both _DEFAULT--VPC_SERVICE_IP (IPv4) and _DEFAULT--VPC_SERVICE_IP_V6 (IPv6) allocations; NotFound is silently skipped so VNA-only, VNS-IPv4-only, VNS-IPv6-only, and VNS-dual-stack all work correctly. - AVI: collect NetworkAddress from every VpcSubnetStatus result (one per IP family for dual-stack) instead of only Results[0]. LoadBalancerIPAddresses (existing field) is kept backward-compatible via a new primaryLBIP helper that follows the Kubernetes convention: IPv4 preferred for dual-stack, IPv6-only fallback, empty for no-LB. LoadBalancerBackendIPs is sorted before reflect.DeepEqual in setNetworkInfoVPCStatus to prevent spurious CR updates when IPs are returned in a different order. Unit tests added/updated for all modified functions across: pkg/nsx/services/realizestate, pkg/nsx/services/vpc, pkg/controllers/networkinfo (controller + utils). E2E tests added in test/e2e/nsx_networkinfo_test.go: testLBBackendIPsPopulated, testDualStackLBBackendIPs, testLBBackendIPsIdempotent.
Collaborator
|
Can one of the admins verify this patch? |
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (56.38%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #1432 +/- ##
==========================================
- Coverage 77.00% 75.80% -1.20%
==========================================
Files 154 155 +1
Lines 21995 22103 +108
==========================================
- Hits 16938 16756 -182
- Misses 3854 3868 +14
- Partials 1203 1479 +276
🚀 New features to boost your workflow:
|
yanjunz97
reviewed
May 19, 2026
Contributor
yanjunz97
left a comment
There was a problem hiding this comment.
Overall LGTM, just a nit
| }) | ||
| } | ||
|
|
||
| func (service *RealizeStateService) GetPolicyInterfaceIP(realizedPath string) (string, error) { |
Contributor
There was a problem hiding this comment.
Maybe remove this function as it is not used any more?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The LoadBalancerBackendIPs field was declared in VPCState but never populated. This change wires it up for all three LB paths:
Testing done:
→ LoadBalancerBackendIPs populated (NSX LB non-TEP-less, CTGW testbed)
-> NSX API source confirmed — operator reads gateway-interface realized entity: