Add support for container healthchecks#41012
Open
OneBlue wants to merge 9 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds container healthcheck support to the wslc container workflow end-to-end (CLI parsing/validation → service model → session/container creation → inspect JSON schema), with corresponding unit and e2e coverage.
Changes:
- Add new
wslcCLI healthcheck options (--health-*,--no-healthcheck) with duration parsing/validation and localized error strings. - Plumb healthcheck configuration through container creation and surface health state/config via
container inspect. - Add unit tests and e2e tests validating forwarding, invalid-argument handling, and runtime healthy/unhealthy transitions.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/windows/WSLCTests.cpp | Adds integration-style tests covering image healthcheck inheritance/override/disable and flag validity updates. |
| test/windows/wslc/WSLCCLIResourceLimitsParserUnitTests.cpp | Adds unit tests for duration parsing/validation used by healthcheck options. |
| test/windows/wslc/e2e/WSLCE2EHelpers.h | Declares a helper to wait for expected container health status in e2e tests. |
| test/windows/wslc/e2e/WSLCE2EHelpers.cpp | Implements WaitForContainerHealth() polling via container inspect. |
| test/windows/wslc/e2e/WSLCE2EContainerRunTests.cpp | Adds e2e coverage for container run health options and health status behavior; updates help text expectations. |
| test/windows/wslc/e2e/WSLCE2EContainerCreateTests.cpp | Adds e2e coverage for container create health options and invalid combinations; updates help text expectations. |
| test/windows/wslc/CommandLineTestCases.h | Adds CLI parsing test cases for new healthcheck arguments for run/create. |
| src/windows/wslcsession/WSLCContainer.cpp | Maps Docker health/config into wslc_schema inspect results; forwards healthcheck config on container create (including disable/conflict). |
| src/windows/wslc/tasks/ContainerTasks.cpp | Plumbs parsed CLI args into the service-layer ContainerOptions model. |
| src/windows/wslc/services/ContainerService.cpp | Applies model healthcheck options onto WSLCContainerLauncher for container creation/run. |
| src/windows/wslc/services/ContainerModel.h | Extends ContainerOptions with healthcheck fields and NoHealthcheck flag. |
| src/windows/wslc/commands/ContainerRunCommand.cpp | Exposes new health-related arguments on container run. |
| src/windows/wslc/commands/ContainerCreateCommand.cpp | Exposes new health-related arguments on container create. |
| src/windows/wslc/arguments/ArgumentValidation.h | Declares duration validation/parsing APIs. |
| src/windows/wslc/arguments/ArgumentValidation.cpp | Implements duration parsing to nanoseconds and argument validation for health options and conflicts. |
| src/windows/wslc/arguments/ArgumentDefinitions.h | Defines new argument types for healthcheck CLI options. |
| src/windows/service/inc/WSLCShared.idl | Adds container flags for healthcheck enable/disable and updates valid-flags mask. |
| src/windows/service/inc/wslc.idl | Extends WSLCContainerOptions with healthcheck fields for session/container creation. |
| src/windows/inc/wslc_schema.h | Extends inspect JSON schema to include health state and healthcheck configuration. |
| src/windows/inc/docker_schema.h | Extends Docker request/inspect schema structs to include healthcheck config and health state parsing. |
| src/windows/common/WSLCContainerLauncher.h | Adds launcher setters and state for healthcheck options and disable flag. |
| src/windows/common/WSLCContainerLauncher.cpp | Populates WSLCContainerOptions health fields and sets the appropriate flags when configured. |
| localization/strings/en-US/Resources.resw | Adds localized CLI descriptions and errors for healthcheck options and invalid duration/conflicts. |
9 tasks
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 support for container healthchecks and various related command line arguments
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed