fix: containerdfunc - #9196
Open
Tim Wright (timmy-wright) wants to merge 1 commit into
Open
Conversation
Tim Wright (timmy-wright)
requested review from
Chou Hu (AbelHu),
Devinwong,
Sri Harsha (SriHarsha001),
Nishchay (awesomenix),
Calvin S. (calvin197),
Cameron Meissner (cameronmeissner),
Sylvain Boily (djsly),
Ganeshkumar Ashokavardhanan (ganeshkumarashok),
Karen Chen (karenychen),
lilypan26,
Mark Ibrahim (mxj220),
Peter Damianov (pdamianov-dev),
Patrick W. Healy (phealy),
r2k1,
Runzhen (runzhen),
sulixu,
Thibault Cohen (titilambert),
Xu Xue (xuexu6666) and
Zachary (zachary-bailey)
as code owners
August 13, 2026 05:40
Contributor
Windows Unit Test Results 3 files 12 suites 45s ⏱️ For more details on these failures, see this check. Results for commit c7ce7eb. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to harden the Windows CSE containerdfunc.ps1 implementation by refactoring service registration and standardizing file writes, and adds Pester coverage for RegisterContainerDService.
Changes:
- Refactors
RegisterContainerDServiceto use helper functions (Remove-ServiceIfExists,Invoke-Nssm) instead of inlinesc.exe/nssm.execalls. - Introduces
Get-RootRegistryPathandOut-FileAsciito make registry path/file output behavior more testable and consistent. - Adds new Pester tests covering
RegisterContainerDServiceservice-removal behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| staging/cse/windows/containerdfunc.ps1 | Adds helper wrappers and refactors containerd service/registry config logic to use them. |
| staging/cse/windows/containerdfunc.tests.ps1 | Adds Pester tests for RegisterContainerDService and updates sourcing order. |
Suppressed comments (1)
staging/cse/windows/containerdfunc.ps1:10
- Typo in comment: "overriden" should be "overridden".
# Function so it can be overriden in tests.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1
to
+2
| . $PSScriptRoot\helpers.ps1 | ||
|
|
| return "ltsc2022" | ||
| } | ||
|
|
||
| . $PSScriptRoot\helpers.ps1 |
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.
harden containerd func
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #