Skip to content

wslc: add network create, delete, and list#40179

Open
beena352 wants to merge 5 commits intomicrosoft:feature/wsl-for-appsfrom
beena352:user/beenachauhan/network-crud
Open

wslc: add network create, delete, and list#40179
beena352 wants to merge 5 commits intomicrosoft:feature/wsl-for-appsfrom
beena352:user/beenachauhan/network-crud

Conversation

@beena352
Copy link
Copy Markdown

@beena352 beena352 commented Apr 14, 2026

Summary of the Pull Request

Adds WSLC custom network management (create, delete, list) via the Docker Engine API. This is the first PR in the network support series, subsequent PRs will add inspect, container-on-network, SDK, and CLI support.

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

  • Adds CreateNetwork, DeleteNetwork, and ListNetworks to the IWSLCSession COM interface, following the existing volume API pattern
  • New IDL types: WSLCNetworkOptions (with Labels and a JSON Options string) and WSLCNetworkInformation
  • Docker schema additions: IPAMConfig, IPAM, CreateNetwork, CreateNetworkResponse, Network
  • New file: WSLCNetworkMetadata.h for label constant, driver constant, reserved name validation, and NetworkEntry struct
  • Only the bridge driver is supported; Docker reserved names (bridge, host, none) are rejected
  • Options are passed as a JSON string to support mixed types (e.g., {"Internal": true, "Subnet": "172.28.0.0/16"}). Gateway requires Subnet

Validation Steps Performed

Tests covering: CRUD lifecycle, duplicate name handling, delete-not-found, subnet/gateway options, internal network flag, user labels, invalid driver/name/options/JSON, session recovery, and multi-network create/list/delete.

Copilot AI review requested due to automatic review settings April 14, 2026 19:02
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

Note

Copilot was unable to run its full agentic suite in this review.

Adds WSLC custom network management (create, delete, list) backed by the Docker Engine API, including COM/IDL surface area, persistence/recovery in the session, Docker schema bindings, and TAEF coverage.

Changes:

  • Extend IWSLCSession with CreateNetwork, DeleteNetwork, ListNetworks and add corresponding IDL structs/constants.
  • Implement network bookkeeping (in-memory map + recovery via managed-label) and Docker HTTP client endpoints.
  • Add docker schema types for network create/list and TAEF tests covering network CRUD and validation.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
test/windows/WSLCTests.cpp Adds TAEF tests for network create/delete/list, options parsing, reserved name/driver validation, and session recovery.
src/windows/wslcsession/WSLCSession.h Adds network methods to the session interface and introduces network lock/map + recovery hook.
src/windows/wslcsession/WSLCSession.cpp Implements network CRUD/list, termination cleanup, and recovery of WSLC-managed networks.
src/windows/wslcsession/WSLCNetworkMetadata.h Introduces constants (managed label/driver) and reserved-name validation helper + entry struct.
src/windows/wslcsession/DockerHTTPClient.h Adds Docker client APIs for network create/remove/list.
src/windows/wslcsession/DockerHTTPClient.cpp Implements HTTP transactions for Docker network endpoints.
src/windows/service/inc/wslc.idl Adds IDL types for network options/info, new session methods, and a not-found HRESULT.
src/windows/inc/docker_schema.h Adds JSON (de)serialization types for network create/list including IPAM fields.
localization/strings/en-US/Resources.resw Adds user-facing localized strings for network errors and invalid options.

@beena352 beena352 requested a review from Copilot April 14, 2026 19:56
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

Copilot reviewed 9 out of 9 changed files in this pull request and generated 15 comments.

@beena352 beena352 requested a review from Copilot April 14, 2026 20:29
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

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

@beena352 beena352 marked this pull request as ready for review April 14, 2026 20:56
@beena352 beena352 requested a review from a team as a code owner April 14, 2026 20:56
Copilot AI review requested due to automatic review settings April 14, 2026 20:56
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

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

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