Suppress unsupported --rm in WSLC image builds - #603
Suppress unsupported --rm in WSLC image builds#603Brandon Waterloo [MSFT] (bwateratmsft) merged 3 commits into
--rm in WSLC image builds#603Conversation
Co-authored-by: bwateratmsft <36966225+bwateratmsft@users.noreply.github.com>
Brandon Waterloo [MSFT] (bwateratmsft)
left a comment
There was a problem hiding this comment.
Copilot if we don't already have a WSLC canary test for --rm, please add one. Those negative-canary tests that assert that WSLC still doesn't have the option--so that if it is added, we notice
--rm in WSLC image builds
Co-authored-by: bwateratmsft <36966225+bwateratmsft@users.noreply.github.com>
Added the WSLC |
There was a problem hiding this comment.
🟢 Approval recommended
The change is small, scoped to the default build template, and includes targeted regression tests covering both the WSLC CLI behavior and the extension’s default command generation.
Pull request overview
This PR updates the Container Tools extension’s default image build command template to avoid passing --rm when the selected container runtime is WSLC, which currently rejects that flag, and adds regression coverage to ensure the default WSLC build command stays compatible.
Changes:
- Introduce a runtime-aware
${rm}placeholder for the default build command template and omit it for WSLC. - Update
selectBuildCommandto provide${rm}based on the selected runtime client ID. - Add tests validating (a) WSLC CLI still does not advertise
--rmforbuild, and (b) the extension’s default WSLC build command does not include--rm.
File summaries
| File | Description |
|---|---|
| packages/vscode-container-client/src/test/clients/WslcClient/WslcCanary.test.ts | Adds a canary test asserting wslc build --help still lacks --rm. |
| extensions/vscode-containers/src/test/commands/selectCommandTemplate.test.ts | Adds a unit test verifying the default WSLC build command args omit --rm. |
| extensions/vscode-containers/src/commands/selectCommandTemplate.ts | Injects a runtime-dependent ${rm} variable for build command template resolution. |
| extensions/vscode-containers/package.json | Updates the default build command template to use ${rm} instead of hardcoding --rm. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
WSLC rejects the default image build command because it does not support
--rm.--rmwhen WSLC is selected.--rmfor other container runtimes.--rm.