fix: aliases-kubectl v0.13.1 — reliable kubectl download with checksum verification - #274
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens aliases-kubectl’s Set-KubectlLocal workflow by introducing a checksum-verified, atomic kubectl downloader to prevent partial/corrupt binaries from replacing an existing known-good install.
Changes:
- Add
Invoke-KubectlDownload(internal) to download kubectl via streaming + progress, verify against the published.sha256, and move into place only after verification. - Update
Set-KubectlLocalto use the new downloader instead of the previous WebClient retry loop. - Bump
aliases-kubectlmodule version to0.13.1.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| modules/aliases-kubectl/Functions/internal.ps1 | Adds Invoke-KubectlDownload for checksum verification + atomic placement. |
| modules/aliases-kubectl/Functions/helper.ps1 | Switches Set-KubectlLocal to call the new internal downloader. |
| modules/aliases-kubectl/aliases-kubectl.psd1 | Bumps ModuleVersion from 0.13.0 → 0.13.1. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Owner
Author
|
Reviewed the 3 Copilot findings on `Invoke-KubectlDownload`; resolving as won't-fix:
|
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
Set-KubectlLocal(which only re-tried on missing-file and could leave a corrupt/partial binary in place) with a new internalInvoke-KubectlDownloadhelper.Invoke-KubectlDownloadfetches the official.sha256checksum first (aborting before any download on failure), streams the binary to a temporary.partfile with progress reporting and a 5-minute request timeout, verifies the SHA256 before accepting, and only then atomically moves the verified file into place — so an interrupted or corrupted download never replaces a known-good binary. Aclean {}block always removes leftover partial files.aliases-kubectlModuleVersion0.13.0 → 0.13.1 (PATCH) in the same module-only commit.Test plan
make lint-diff— pre-commit hooks green (gremlins/shebang/EOF/whitespace/line-ending)/second-opinion(gpt-5.3-codex heterogeneous review) — no findingsSet-KubectlLocalon Linux/macOS/Windows and confirm the correct-archkubectlis downloaded, checksum-verified, and symlinked.partfile is cleaned up🤖 Generated with Claude Code