CLI: Initialize network option#40304
Draft
AmelBawa-msft wants to merge 2 commits intofeature/wsl-for-appsfrom
Draft
CLI: Initialize network option#40304AmelBawa-msft wants to merge 2 commits intofeature/wsl-for-appsfrom
AmelBawa-msft wants to merge 2 commits intofeature/wsl-for-appsfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a --network option to the wslc container create and wslc container run CLI commands and threads that selection through to container creation so callers can choose none, host, or bridge.
Changes:
- Introduces
--networkCLI argument for containercreateandrun, including validation and localized help text. - Plumbs the parsed network selection into
ContainerOptionsand intoWSLCContainerLauncherduring container creation. - Adds E2E coverage for valid (
none,host) and invalid network values, and updates help-text expectations.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/windows/wslc/e2e/WSLCE2EContainerRunTests.cpp | Adds --network E2E tests for container run and updates expected help output. |
| test/windows/wslc/e2e/WSLCE2EContainerCreateTests.cpp | Adds --network E2E tests for container create and updates expected help output. |
| src/windows/wslc/tasks/ContainerTasks.cpp | Parses --network and sets ContainerOptions.NetworkType. |
| src/windows/wslc/services/ContainerService.cpp | Passes options.NetworkType to WSLCContainerLauncher instead of hardcoding bridged. |
| src/windows/wslc/services/ContainerModel.h | Adds NetworkType to ContainerOptions with a default of bridged. |
| src/windows/wslc/commands/ContainerRunCommand.cpp | Exposes the new --network argument on container run. |
| src/windows/wslc/commands/ContainerCreateCommand.cpp | Exposes the new --network argument on container create. |
| src/windows/wslc/arguments/ArgumentValidation.h | Declares network type validation and parsing helpers. |
| src/windows/wslc/arguments/ArgumentValidation.cpp | Implements --network validation and string-to-enum parsing. |
| src/windows/wslc/arguments/ArgumentDefinitions.h | Defines the Network argument type and associates it with localization. |
| localization/strings/en-US/Resources.resw | Adds the localized description string for --network. |
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
--networkoption to container create and container runPR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed