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

kubernetes-sigs / cluster-api-provider-kubevirt / 40880871948
43%
main: 43%

Build:
Build:
LAST BUILD BRANCH: networkdata-secret-ref
DEFAULT BRANCH: main
Ran 29 Oct 2026 01:21PM UTC
Jobs 1
Files 28
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

29 Oct 2026 01:19PM UTC coverage: 43.346% (+0.2%) from 43.159%
40880871948

Pull #393

github

chdxD1
Add cloud-init data source and network data configuration to KubevirtMachine

CAPK builds the cloud-init config drive for every virtual machine and
sets only UserDataSecretRef on it. NetworkDataSecretRef is never set, so
there is no way to hand a static network configuration to the guest, and
guests depend on DHCP. That rules out attaching a cluster to a secondary
network without a DHCP server, and it prevents using addresses that are
allocated outside of the CNI.

The virtualMachineTemplate passthrough is not a workaround, because CAPK
appends its own cloud-init volume to the rendered template. A cloud-init
volume supplied by the user would collide with it.

Add an optional cloudInit section to KubevirtMachineSpec, holding a data
source selector and a network data secret reference.

When networkDataSecretRef is set, the referenced secret is read from the
KubevirtMachine's namespace and its network data is copied into the
bootstrap secret that CAPK already creates in the infra cluster. The
cloud-init volume then points at that secret for both user data and
network data. KubeVirt mounts each reference into its own pod volume, so
one secret is enough and the existing secret lifecycle is reused. Both
the networkdata and networkData keys are accepted, matching the keys
KubeVirt itself looks up.

The data source selector is needed because cloud-init parses the network
configuration document differently per data source. A config drive is
read as OpenStack network_data.json, while NoCloud is read as cloud-init
network configuration version 1 or 2. Without a selector, only the
OpenStack format would ever be usable. The selector defaults to
configDrive, so existing machines keep their current data source.

The provider stays a plain carrier for the document. Rendering the
network configuration and allocating the addresses stay with whoever
creates the KubevirtMachine. This follows the approach that
cluster-api-provider-metal3 takes with Metal3MachineSpec.Netwo... (continued)
Pull Request #393: Add cloud-init data source and network data configuration to KubevirtMachine

67 of 124 new or added lines in 4 files covered. (54.03%)

1482 of 3419 relevant lines covered (43.35%)

2.66 hits per line

Uncovered Changes

Lines Coverage ∆ File
24
0.0
0.0% api/v1alpha1/zz_generated.deepcopy.go
15
0.0
0.0% api/v1alpha1/kubevirtmachine_types.go
12
74.11
0.34% controllers/kubevirtmachine_controller.go
6
79.55
-2.51% pkg/kubevirt/utils.go
Jobs
ID Job ID Ran Files Coverage
1 40880871948.1 29 Oct 2026 01:21PM UTC 28
43.35
GitHub Action Run
Source Files on build 40880871948
  • Tree
  • List 28
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #393
  • PR Base - main (#39807259464)
  • Delete
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