Add wslc network connect and disconnect commands - #41011
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to add wslc network connect and wslc network disconnect CLI subcommands as shims over the existing IWSLCContainer::ConnectToNetwork / DisconnectFromNetwork COM APIs, plus corresponding localization and test help-output updates.
Changes:
- Adds
NetworkService::Connect/NetworkService::Disconnectand corresponding task entrypoints (ConnectNetwork/DisconnectNetwork). - Registers new
connect/disconnectsubcommands under thenetworkroot command and updates the e2e âavailable commandsâ help list. - Adds en-US localization strings for the new subcommandsâ short/long descriptions.
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/wslc/e2e/WSLCE2ENetworkTests.cpp | Adds connect/disconnect to the expected wslc network --help subcommand list. |
| src/windows/wslc/tasks/NetworkTasks.h | Declares new network connect/disconnect task functions. |
| src/windows/wslc/tasks/NetworkTasks.cpp | Implements task shims that call into NetworkService connect/disconnect. |
| src/windows/wslc/services/NetworkService.h | Declares NetworkService::Connect / Disconnect. |
| src/windows/wslc/services/NetworkService.cpp | Implements COM calls to connect/disconnect a container to/from a network. |
| src/windows/wslc/commands/NetworkCommand.h | Declares new NetworkConnectCommand / NetworkDisconnectCommand command types. |
| src/windows/wslc/commands/NetworkCommand.cpp | Registers the new connect / disconnect subcommands under wslc network. |
| localization/strings/en-US/Resources.resw | Adds localized description strings for the new subcommands. |
David Bennett (dkbennett)
left a comment
There was a problem hiding this comment.
This looks good, would recommend putting the tests into the existing network tests just to try to be a little more efficient with builds without significant incremental/maintenance cost added.
Blue (OneBlue)
left a comment
There was a problem hiding this comment.
LGTM. Minor test comment
3392921
Blue (OneBlue)
left a comment
There was a problem hiding this comment.
LGTM, one small test command.
I think we should also implement --alias, --driver-opt, --ip, --link and --link-local-ip, but that can happen in a future change
Summary of the Pull Request
Adds wslc network connect and wslc network disconnect CLI commands as thin shims over the existing IWSLCContainer::ConnectToNetwork / DisconnectFromNetwork COM methods.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed