Skip to content

Return non vhd volumes in container inspect - #41335

Open
Blue (OneBlue) wants to merge 2 commits into
masterfrom
user/oneblue/mounts-guest-volumes
Open

Return non vhd volumes in container inspect#41335
Blue (OneBlue) wants to merge 2 commits into
masterfrom
user/oneblue/mounts-guest-volumes

Conversation

@OneBlue

Copy link
Copy Markdown
Collaborator

Summary of the Pull Request

This change adds logic to return guest volumes in the container inspect's output. For now, the source path is set to null since we don't want to expose VM paths, but this can be revisited later if needed

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

@OneBlue
Blue (OneBlue) requested a review from a team as a code owner August 12, 2026 22:05
Copilot AI lite review requested due to automatic review settings August 12, 2026 22:05
@OneBlue
Blue (OneBlue) requested a review from a team as a code owner August 12, 2026 22:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates WSLC’s container inspect output to include Docker-managed volume mounts (guest/named/anonymous and image-defined VOLUMEs) while intentionally not exposing the utility VM’s internal source paths (emitting Source: null). It also updates schema definitions and expands tests to validate the new inspect behavior.

Changes:

  • Extend Docker and WSLC inspect schemas to include mount Name and make WSLC mount Source nullable.
  • Populate inspect Mounts with Docker-reported volume mounts while continuing to map host bind mounts from WSLC’s host-side tracking.
  • Add/adjust Windows and E2E tests to validate anonymous and Dockerfile-defined volumes appear in inspect output with Source unset.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/windows/WSLCTests.cpp Adds new inspect coverage for anonymous volumes and Dockerfile VOLUME mounts; updates existing mount assertions for nullable Source.
test/windows/wslc/e2e/WSLCE2EContainerRemoveTests.cpp Switches anonymous-volume detection to use container inspect output rather than before/after volume list diffs.
src/windows/wslcsession/WSLCContainer.cpp Updates inspect construction to append Docker volume mounts without exposing utility-VM source paths.
src/windows/inc/wslc_schema.h Updates WSLC inspect mount schema to include Name and nullable Source.
src/windows/inc/docker_schema.h Extends Docker inspect schema parsing to include Mounts and mount Name.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +248 to +249
const auto inspect = InspectContainer(containerName);
const auto mount = std::ranges::find_if(inspect.Mounts, [](const auto& entry) { return entry.Type == "volume"; });

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By design, this expects a single volume mount since that's what the tests do

Comment thread src/windows/wslcsession/WSLCContainer.cpp
Comment thread src/windows/inc/wslc_schema.h
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