Skip to content

Conversation

@akerouanton
Copy link
Member

@akerouanton akerouanton commented Dec 16, 2025

vminitd was not correctly parsing -network args when both an IPv4 and an IPv6 address were provided. Only the latest 'addr' field was kept, overriding the previous one.

Fix that by storing the IPv4 and IPv6 addrs separately, and introduce a unit test to verify this works correctly.

Copilot AI review requested due to automatic review settings December 16, 2025 15:54
vminitd was not correctly parsing -network args when both an IPv4 and
an IPv6 address were provided. Only the latest 'addr' field was kept,
overriding the previous one.

Fix that by storing the IPv4 and IPv6 addrs separately, and introduce a
unit test to verify this works correctly.

Signed-off-by: Albin Kerouanton <[email protected]>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds dual-stack networking support to vminitd by allowing both IPv4 and IPv6 addresses to be configured simultaneously. The changes refactor the network configuration to handle separate Addr4 and Addr6 fields instead of a single Addr field.

Key changes:

  • Modified the Network struct to support separate IPv4 and IPv6 address fields
  • Updated argument parsing and serialization to handle multiple addr parameters
  • Added comprehensive unit tests for the new dual-stack network parsing functionality

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/vminit/vmnetworking/vmnetworking.go Refactored Network struct to use separate Addr4/Addr6 fields and updated validation/configuration logic
internal/shim/task/networking_unix.go Updated InitArgs() to generate network arguments supporting both IPv4 and IPv6 addresses
cmd/vminitd/networking.go Modified network parsing and serialization to handle dual-stack configuration
cmd/vminitd/networking_test.go Added unit tests covering IPv4-only, IPv6-only, dual-stack, and DHCP scenarios
go.mod Added testify dependency for unit testing
Makefile Added test-unit target for running unit tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@austinvazquez austinvazquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@dmcgowan dmcgowan merged commit 78fd29a into containerd:main Dec 18, 2025
3 checks passed
@akerouanton akerouanton deleted the fix-vminitd-nw-args branch December 18, 2025 22:36
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.

4 participants