Return non vhd volumes in container inspect - #41335
Open
Blue (OneBlue) wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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
Nameand make WSLC mountSourcenullable. - Populate inspect
Mountswith Docker-reportedvolumemounts 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
Sourceunset.
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"; }); |
Collaborator
Author
There was a problem hiding this comment.
By design, this expects a single volume mount since that's what the tests do
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed