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

kubeovn / kube-ovn / 23379748527
27%

Build:
DEFAULT BRANCH: master
Ran 21 Mar 2026 12:34PM 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

21 Mar 2026 12:32PM UTC coverage: 23.427% (+0.07%) from 23.361%
23379748527

push

github

web-flow
fix(controller): prevent panics from nil deref and data races in pod controller (#6483)

* fix(controller): prevent panics from nil dereference and data races in pod controller

Fix four panic-causing bugs in pkg/controller/pod.go:

1. Store last known pod instead of nil in deletingPodObjMap when pod
   Get returns NotFound during reconcileAllocateSubnets, preventing
   nil pointer dereference in handleDeletePod.

2. Return a shallow copy of the internal map in GetNamedPortByNs
   instead of the direct reference, preventing concurrent map
   read/write panic when NetworkPolicy reconciliation races with
   pod add/delete.

3. Replace direct c.ipam.Subnets map access in syncKubeOvnNet with
   c.ipam.ReleaseAddressByNic() which properly acquires the IPAM
   mutex, preventing data race panic during network hot-plug/unplug.

4. Add missing error return in appendCheckPodNetToDel after failed
   StatefulSet/VirtualMachine Get (non-NotFound errors), preventing
   nil pointer dereference panic on transient API server errors.
   Also simplify the subsequent nil check for VirtualMachine since
   it is guaranteed non-nil after the early error return.

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): use namespaced key for IPAM release and add unit test

Address review feedback:
- Use namespaced key (namespace/podName) instead of bare podName when
  calling ReleaseAddressByNic in syncKubeOvnNet, matching the key format
  used during IPAM allocation to ensure addresses are properly released.
- Add unit test for GetNamedPortByNs copy semantics to prevent
  reintroducing the concurrent map panic.

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>

* refactor(controller): simplify GetNamedPortByNs with... (continued)

2 of 8 new or added lines in 1 file covered. (25.0%)

12935 of 55214 relevant lines covered (23.43%)

0.27 hits per line

Uncovered Changes

Lines Coverage ∆ File
6
14.0
1.7% pkg/controller/pod.go
Jobs
ID Job ID Ran Files Coverage
1 23379748527.1 21 Mar 2026 12:34PM UTC 205
23.43
GitHub Action Run
Source Files on build 23379748527
  • Tree
  • List 205
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 3c8fb0e1 on github
  • Prev Build on master (#23367066144)
  • Next Build on master (#23380864593)
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