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

kubeovn / kube-ovn / 30184375418
28%
master: 28%

Build:
Build:
LAST BUILD BRANCH: codex/ipam-pod-events-master
DEFAULT BRANCH: master
Ran 26 Jul 2026 05:32AM UTC
Jobs 1
Files 220
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 Jul 2026 02:19AM UTC coverage: 28.035% (+0.02%) from 28.013%
30184375418

Pull #7078

github

pujitha24
fix(vpcnatgw): attach subnet NAD in non-primary CNI mode so LanIP is injected

## What type of this PR

- Bug fixes

## Which issue(s) this PR fixes

Fixes #6744

## Motivation

When Kube-OVN runs as a non-primary CNI (`--enable-non-primary-cni-mode`),
a VpcNatGateway's `lanIp` is never injected into the gateway pod: the pod
only ends up with the primary CNI's eth0 and the external-network
interface, never an interface for the internal OVN subnet, so the VPC
cannot reach the external network through the gateway.

PR #6675 (fixing #6632) made `GenNatGwPodAnnotations` skip setting
`v1.multus-cni.io/default-network` to the subnet's NetworkAttachmentDefinition
(NAD) in non-primary CNI mode, so eth0 correctly stays on the cluster's
primary CNI. However it never attached that NAD anywhere else. The
`ovn.kubernetes.io/logical_switch_provider.<p>` /
`ovn.kubernetes.io/ip_address_provider.<p>` pod annotations that carry the
LanIP were still being set, but with the NAD never listed in
`k8s.v1.cni.cncf.io/networks`, multus never invokes the kube-ovn CNI plugin
for it, so those annotations are never consumed and no interface is ever
created. Before this fix, the only way to get LanIP injected was the manual
workaround of adding the NAD to the VpcNatGateway's
`k8s.v1.cni.cncf.io/networks` annotation by hand.

## Approach

In `GenNatGwPodAnnotations` (pkg/util/vpc_nat_gateway.go), when running in
non-primary CNI mode with a custom NAD-backed provider, attach the
subnet's own NAD to `k8s.v1.cni.cncf.io/networks` as an additional
(non-default) network instead of just skipping it. It is appended after
the external NAD and any user-supplied additional networks, rather than
prepended, so the external NAD keeps the same position it already had
(some code, e.g. the default egress QoS interface in
`execNatGwQoSInPod`, assumes the external NAD is `net1` when no extra
networks are configured).

The `v1.multus-cni.io/default-network` override remains skipped in
non-primary CN... (continued)
Pull Request #7078: fix(vpcnatgw): attach subnet NAD in non-primary CNI mode so LanIP is injected

21 of 21 new or added lines in 1 file covered. (100.0%)

2 existing lines in 1 file now uncovered.

17089 of 60955 relevant lines covered (28.04%)

0.33 hits per line

Coverage Regressions

Lines Coverage ∆ File
2
75.73
-0.53% pkg/ovs/ovn-nb-logical_router_route.go
Jobs
ID Job ID Ran Files Coverage
1 30184375418.1 26 Jul 2026 05:32AM UTC 220
28.04
GitHub Action Run
Source Files on build 30184375418
  • Tree
  • List 220
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #7078
  • PR Base - master (#30181278144)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc