Skip to content

CLI: Initialize network option#40304

Draft
AmelBawa-msft wants to merge 2 commits intofeature/wsl-for-appsfrom
user/amelbawa/net
Draft

CLI: Initialize network option#40304
AmelBawa-msft wants to merge 2 commits intofeature/wsl-for-appsfrom
user/amelbawa/net

Conversation

@AmelBawa-msft
Copy link
Copy Markdown

@AmelBawa-msft AmelBawa-msft commented Apr 24, 2026

Summary of the Pull Request

  • Added --network option to container create and container run
  • Input validation
  • E2E tests for none, host, and invalid network modes on both create and run commands.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Copilot AI review requested due to automatic review settings April 24, 2026 08:21
Copy link
Copy Markdown
Contributor

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

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 --network CLI argument for container create and run, including validation and localized help text.
  • Plumbs the parsed network selection into ContainerOptions and into WSLCContainerLauncher during 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.

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.

2 participants