Skip to content

Add support for container healthchecks#41012

Open
OneBlue wants to merge 9 commits into
masterfrom
user/oneblue/health
Open

Add support for container healthchecks#41012
OneBlue wants to merge 9 commits into
masterfrom
user/oneblue/health

Conversation

@OneBlue

@OneBlue OneBlue commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary of the Pull Request

This change adds support for container healthchecks and various related command line arguments

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

Copilot AI review requested due to automatic review settings July 7, 2026 00:47

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 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 wslc CLI 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.

@OneBlue OneBlue marked this pull request as ready for review July 7, 2026 23:40
@OneBlue OneBlue requested a review from a team as a code owner July 7, 2026 23:40
Copilot AI review requested due to automatic review settings July 7, 2026 23:40

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

Copilot reviewed 23 out of 23 changed files in this pull request and generated no new 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