Skip to content

fix: containerdfunc - #9196

Open
Tim Wright (timmy-wright) wants to merge 1 commit into
mainfrom
timmy/containerdfunc
Open

fix: containerdfunc#9196
Tim Wright (timmy-wright) wants to merge 1 commit into
mainfrom
timmy/containerdfunc

Conversation

@timmy-wright

Copy link
Copy Markdown
Contributor

harden containerd func

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

@github-actions

Copy link
Copy Markdown
Contributor

Windows Unit Test Results

  3 files   12 suites   45s ⏱️
393 tests 317 ✅ 0 💤 76 ❌
396 runs  317 ✅ 0 💤 79 ❌

For more details on these failures, see this check.

Results for commit c7ce7eb.

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 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 RegisterContainerDService to use helper functions (Remove-ServiceIfExists, Invoke-Nssm) instead of inline sc.exe/nssm.exe calls.
  • Introduces Get-RootRegistryPath and Out-FileAscii to make registry path/file output behavior more testable and consistent.
  • Adds new Pester tests covering RegisterContainerDService service-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
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