Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Windows log collection/cleanup to account for aks-windows-exporter logs and adds Windows e2e coverage to ensure the collect-windows-logs.ps1 script can be executed and produces a zip bundle.
Changes:
- Include
aks-windows-exporterlog files in Windows log cleanup generation and “locked file” handling. - Add e2e validator + scenarios for Windows Server 2022/2025 to run
c:\k\debug\collect-windows-logs.ps1and verify a zip is produced. - Remove the legacy/stub
vhdbuilder/scripts/windows/collect-windows-logs.ps1reference file (moved tostaging/...).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| vhdbuilder/scripts/windows/collect-windows-logs.ps1 | Removes the old stub note pointing to the staging script location. |
| staging/cse/windows/provisioningscripts/windowslogscleanup.ps1 | Adds aks-windows-exporter prefixes to cleanup rotation logic. |
| staging/cse/windows/provisioningscripts/loggenerator.ps1 | Adds aks-windows-exporter log filenames to generated log set. |
| staging/cse/windows/debug/collect-windows-logs.ps1 | Adds aks-windows-exporter logs to the locked-files list used during collection. |
| e2e/validators.go | Adds a validator that runs the Windows log collection script and checks for a produced zip. |
| e2e/scenario_win_test.go | Adds Windows 2022 and Windows 2025 scenarios that invoke the new validator. |
djsly
approved these changes
Apr 1, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
staging/cse/windows/provisioningscripts/windowslogscleanup.ps1:20
- windowslogscleanup.ps1 is executed via powershell.exe (Windows PowerShell 5.1) by the scheduled task registration. Select-Object -SkipLast is not supported in Windows PowerShell 5.1, so this line will throw and prevent log cleanup from running. Consider replacing it with PS 5.1-compatible logic to keep the newest 5 logs (e.g., compute Count-5 and Select-Object -First).
$logFilePrefixes = @("kubelet", "kubelet.err", "kubeproxy", "kubeproxy.err", "containerd.err", "containerd", "windows-exporter.err", "windows-exporter","aks-windows-exporter.err", "aks-windows-exporter")
foreach ($logFilePrefix in $logFilePrefixes) {
$oldLogs = [IO.Directory]::GetFiles("c:\k", "$($logFilePrefix)-*.log")
$oldLogs = $oldLogs | Sort-Object | Select-Object -SkipLast 5
59bcdff to
6b4e3da
Compare
6b4e3da to
1ab6d88
Compare
djsly
approved these changes
Apr 2, 2026
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.
What this PR does / why we need it:
Because the log collection script was failing.
Which issue(s) this PR fixes:
Fixes #