Fix wslc create network filaure without driver specified#40788
Fix wslc create network filaure without driver specified#40788chemwolf6922 wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes wslc network create failing when --driver is not provided by ensuring the CLI task always supplies a default network driver (bridge) to the underlying WSLC session API. This aligns runtime behavior with the CLI help text and enables the previously-disabled E2E coverage for the default-driver path.
Changes:
- Default
CreateNetworkOptions.Driverto"bridge"when--driveris omitted innetwork create. - Re-enable the E2E test that validates creating a network without specifying a driver.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/windows/wslc/e2e/WSLCE2ENetworkCreateTests.cpp | Re-enables the default-driver network create E2E test and asserts the created network uses bridge. |
| src/windows/wslc/tasks/NetworkTasks.cpp | Ensures options.Driver is always populated (defaults to "bridge" when not specified). |
dkbennett
left a comment
There was a problem hiding this comment.
I don't think it is correct for the CLI to be setting a default if the service sets one. The service should handle that and the CLI should not be setting its own default.
|
To add some additional context:
|
|
@OneBlue Do we want to allow "" being treated as default? |
No I think we should consider null being the default, or "" should be rejected |
Summary of the Pull Request
The WSLCSession::CreateNetwork expects Options->Driver to be populated. However, when the driver is not specified in the cli. It's skipped and default to NULL. This PR populates it with the default "bridge" driver when not specified.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
Enable test:
WSLCE2ETests::WSLCE2ENetworkCreateTests::WSLCE2E_Network_Create_DefaultDriver_Success