• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kubeovn / kube-ovn / 23588768977
24%

Build:
DEFAULT BRANCH: master
Ran 26 Mar 2026 10:12AM UTC
Jobs 1
Files 205
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

26 Mar 2026 10:10AM UTC coverage: 24.106% (+0.02%) from 24.089%
23588768977

push

github

web-flow
fix(controller): defer subnet processing until vlan is fully ready (#6527)

* fix(controller): clear subnet IP status when vlan conflict is detected

When two VLANs with the same ID are created on the same provider network,
a race condition causes the conflict subnet to retain its IP range in
status. This happens because:

1. The subnet handler can process the subnet before the vlan handler
   marks the vlan as conflicting (informer cache propagation delay of
   ~3ms), allowing IPAM allocation and IP status to be set.

2. When the vlan handler detects a conflict, it returns early without
   re-enqueuing associated subnets, so the subnet is never re-validated.

3. Even when the subnet is re-processed and detects the vlan conflict,
   patchSubnetStatus serializes the full status (including the stale IP
   range) without clearing IP fields.

Fix all three issues:
- In handleAddVlan/handleUpdateVlan: re-enqueue subnets referencing the
  conflicting vlan so they can re-validate.
- In handleAddOrUpdateSubnet: when vlan validation fails, remove the
  subnet from IPAM and clear all IP status fields before patching.

Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com>

* fix(controller): address review feedback for vlan conflict handling

Address Copilot review comments:

1. Prevent queue churn: only re-enqueue subnets when vlan conflict
   status transitions from false to true (not on every retry). Save
   wasConflict before checkVlanConflict and gate the re-enqueue.

2. Scope IPAM cleanup: introduce errVlanConflict sentinel error in
   validateSubnetVlan and only clear IPAM/IP status fields when
   errors.Is(err, errVlanConflict) is true. Transient lister errors
   no longer trigger IPAM deletion.

3. Add unit tests: Test_validateSubnetVlan_conflict verifies the
   sentinel error is correctly returned for conflict vs normal vs
   missing... (continued)

9 of 33 new or added lines in 2 files covered. (27.27%)

13360 of 55422 relevant lines covered (24.11%)

0.28 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
7
10.03
0.67% pkg/controller/subnet.go
17
0.0
0.0% pkg/controller/vlan.go
Jobs
ID Job ID Ran Files Coverage
1 23588768977.1 26 Mar 2026 10:12AM UTC 205
24.11
GitHub Action Run
Source Files on build 23588768977
  • Tree
  • List 205
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 0074ae34 on github
  • Prev Build on master (#23583978396)
  • Next Build on master (#23630179185)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc