Add container:<name id> network mode for WSLC containers#40502
Open
beena352 wants to merge 10 commits into
Open
Add container:<name id> network mode for WSLC containers#40502beena352 wants to merge 10 commits into
beena352 wants to merge 10 commits into
Conversation
…eenachauhan/wslc-multi-network-container
…eenachauhan/wslc-multi-network-container
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for Docker’s container:<name|id> network mode in WSLC so a container can share another container’s network namespace, alongside expanded support for attaching multiple networks.
Changes:
- Introduces
WSLCContainerNetworkTypeContainerand parses/round-trips Dockercontainer:<id>network mode. - Reworks container network options to support multiple network attachments and validates unsupported combinations (ports/additional networks with container mode).
- Extends inspect/network schema and adds tests for container-mode and multi-network behaviors.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/windows/WSLCTests.cpp | Adds coverage for multi-network attach behavior and container network mode validation/round-trip. |
| src/windows/wslcsession/WSLCContainer.cpp | Implements container network mode resolution, additional network validation/attachment, and inspect network mapping. |
| src/windows/service/inc/wslc.idl | Adds new network type and changes the network options struct to support multiple attachments. |
| src/windows/inc/wslc_schema.h | Extends inspect schema to include per-network endpoint settings. |
| src/windows/inc/docker_schema.h | Adds create-time NetworkingConfig and inspect-time NetworkSettings schema support. |
| src/windows/common/WSLCContainerLauncher.h | Adds launcher API for specifying additional networks. |
| src/windows/common/WSLCContainerLauncher.cpp | Builds WSLCNetworkAttachment[] for primary + additional networks in container options. |
| localization/strings/en-US/Resources.resw | Adds localized strings for new validation errors and reserved fields. |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
src/windows/inc/docker_schema.h:1
- Adding
NetworkingConfigas a non-optional field changes the serialized JSON for all container creates, including those that don’t use additional networks (it will still serialize an emptyNetworkingConfig/EndpointsConfig). To minimize risk of Docker API behavior differences/regressions and reduce payload noise, consider makingNetworkingConfigoptional (or customizing serialization) so it’s only present whenEndpointsConfigis non-empty.
/*++
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.
Summary of the Pull Request
Adds support for Docker's container:<name|id> network mode, allowing a WSLC container to share the network namespace of an existing container.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed