Skip to content

shim/task: relax VM network config validation#94

Open
akerouanton wants to merge 1 commit intocontainerd:mainfrom
akerouanton:relax-vm-nw-validation
Open

shim/task: relax VM network config validation#94
akerouanton wants to merge 1 commit intocontainerd:mainfrom
akerouanton:relax-vm-nw-validation

Conversation

@akerouanton
Copy link
Member

Allow VM network interfaces to be configured without an IP address or DHCP enabled. This validation rule was preventing the use of /31 networks.

Most of the time, the VM doesn't need to have an IP address assigned since its interface is added to the bridge network that serves the container. However, this means containers running within the 'host' network namespace won't have any connectivity. It's up to the higher-level runtime to decide whether this is an acceptable trade-off.

Copilot AI review requested due to automatic review settings February 12, 2026 10:02
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

Relaxes validation for VM network configuration so interfaces can be specified with only a MAC (no static IP and no DHCP), enabling use cases like /31 networks and pure L2 bridging.

Changes:

  • Relax network validation in vminit to only require a MAC address (and forbid addr+dhcp together).
  • Relax shim annotation parsing to only require endpoint/mode/mac (no longer requires addr or dhcp).
  • Update VM configuration docs to mark addr as optional and document the “no IP assigned” behavior.

Reviewed changes

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

File Description
internal/vminit/vmnetworking/vmnetworking.go Loosens validation to allow interfaces without addr/DHCP while still enforcing MAC and mutual exclusivity of addr vs DHCP.
internal/shim/task/networking_unix.go Loosens annotation parsing validation to match the new “no IP required” behavior.
docs/vm-configuration.md Documents that addr is optional and explains behavior when neither addr nor dhcp are set.

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

Allow VM network interfaces to be configured without an IP address or
DHCP enabled. This validation rule was preventing the use of /31
networks.

Most of the time, the VM doesn't need to have an IP address assigned
since its interface is added to the bridge network that serves the
container. However, this means containers running within the 'host'
network namespace won't have any connectivity. It's up to the
higher-level runtime to decide whether this is an acceptable trade-off.

Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com>
@akerouanton akerouanton force-pushed the relax-vm-nw-validation branch from 539fc57 to 6c1a6a2 Compare February 12, 2026 11:09
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.

1 participant