shim/task: relax VM network config validation#94
Open
akerouanton wants to merge 1 commit intocontainerd:mainfrom
Open
shim/task: relax VM network config validation#94akerouanton wants to merge 1 commit intocontainerd:mainfrom
akerouanton wants to merge 1 commit intocontainerd:mainfrom
Conversation
There was a problem hiding this comment.
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
addras 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>
539fc57 to
6c1a6a2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.