Skip to content

Support auto-allocate VLAN for SubnetConnectionBindingMap#1445

Draft
wenqiq wants to merge 5 commits into
vmware-tanzu:mainfrom
wenqiq:topic/wenqi/VLAN-auto-allocation
Draft

Support auto-allocate VLAN for SubnetConnectionBindingMap#1445
wenqiq wants to merge 5 commits into
vmware-tanzu:mainfrom
wenqiq:topic/wenqi/VLAN-auto-allocation

Conversation

@wenqiq
Copy link
Copy Markdown
Contributor

@wenqiq wenqiq commented Jun 2, 2026

When spec.vlanTrafficTag is not set, the subnetbinding controller allocates a VLAN from [0, 4094], writes it to spec, and realizes the NSX binding map. Used VLANs are discovered via NSX search on parent Subnet paths so bindings created outside the Supervisor are included. VLAN extension child Subnets prefer spec/status vlanId when it is still free on the target.

wenqiq added 5 commits June 2, 2026 13:37
When spec.vlanTrafficTag is not set, the subnetbinding controller allocates
a VLAN from [0, 4094], writes it to spec, and realizes the NSX binding map.
Used VLANs are discovered via NSX search on parent Subnet paths so bindings
created outside the Supervisor are included. VLAN extension child Subnets
prefer spec/status vlanId when it is still free on the target.

Signed-off-by: Wenqi Qiu <wenqi.qiu@broadcom.com>
Signed-off-by: Wenqi Qiu <wenqi.qiu@broadcom.com>
Signed-off-by: Wenqi Qiu <wenqi.qiu@broadcom.com>
Signed-off-by: Wenqi Qiu <wenqi.qiu@broadcom.com>
Signed-off-by: Wenqi Qiu <wenqi.qiu@broadcom.com>
@wenqiq wenqiq force-pushed the topic/wenqi/VLAN-auto-allocation branch from 018d05f to 3443291 Compare June 2, 2026 11:09
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 12.03008% with 117 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.68%. Comparing base (7244967) to head (3443291).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
pkg/nsx/services/subnetbinding/vlan_allocation.go 0.00% 61 Missing ⚠️
...trollers/subnetbinding/subnetbinding_controller.go 2.04% 47 Missing and 1 partial ⚠️
pkg/nsx/services/vlanpool/vlanpool.go 73.68% 3 Missing and 2 partials ⚠️
pkg/nsx/services/subnetbinding/builder.go 25.00% 2 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (12.03%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1445      +/-   ##
==========================================
+ Coverage   77.03%   77.68%   +0.64%     
==========================================
  Files         156      186      +30     
  Lines       22221    24483    +2262     
==========================================
+ Hits        17118    19019    +1901     
- Misses       3891     4184     +293     
- Partials     1212     1280      +68     
Flag Coverage Δ
unit-tests 77.68% <12.03%> (+0.64%) ⬆️
Files with missing lines Coverage Δ
pkg/nsx/services/subnetbinding/builder.go 87.23% <25.00%> (-5.95%) ⬇️
pkg/nsx/services/vlanpool/vlanpool.go 73.68% <73.68%> (ø)
...trollers/subnetbinding/subnetbinding_controller.go 67.11% <2.04%> (-10.00%) ⬇️
pkg/nsx/services/subnetbinding/vlan_allocation.go 0.00% <0.00%> (ø)

... and 41 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants