v0.2.4 — Distribution
Shell completion
# bash (~/.bashrc)
source <(kubectl snapshot completion bash)
# zsh (~/.zshrc)
source <(kubectl snapshot completion zsh)
# fish (~/.config/fish/config.fish)
kubectl snapshot completion fish | source
# PowerShell ($PROFILE)
kubectl snapshot completion powershell | Out-String | Invoke-ExpressionSARIF output for GitHub Code Scanning
analyze --output sarif emits SARIF 2.1.0 compatible with the GitHub Code Scanning upload action. Each pod/node/workload/storage issue becomes a result with a rule ID, severity level, and logical resource location.
# .github/workflows/cluster-scan.yml
- run: kubectl snapshot analyze snap.json --output sarif > results.sarif
- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarifRules emitted: snapshot/pod-issue (error), snapshot/node-issue (error), snapshot/workload-issue (warning/error), snapshot/storage-issue (warning/error), snapshot/warning-event (note).
Krew and Homebrew distribution
GoReleaser now auto-publishes the krew manifest to whtssub/krew-index and the Homebrew formula to whtssub/homebrew-tap on every release.
# Homebrew
brew install whtssub/tap/kubectl-snapshot
# krew (after kubernetes-sigs/krew-index PR is accepted)
kubectl krew install snapshotChecksums verification
Every release ships checksums.txt. Verify your download:
curl -LO https://github.com/whtssub/kubectl-snapshot/releases/download/v0.2.4/kubectl-snapshot_Linux_x86_64.tar.gz
curl -LO https://github.com/whtssub/kubectl-snapshot/releases/download/v0.2.4/checksums.txt
# Linux
sha256sum --check --ignore-missing checksums.txt
# macOS
shasum -a 256 --check --ignore-missing checksums.txtInternals
internal/cli/completion.go— Cobra's built-inGenBashCompletionV2/GenZshCompletion/GenFishCompletion/GenPowerShellCompletionWithDescinternal/snapshot/sarif.go—renderSARIF(),sarifRulescatalogue,extractResourceFromIssue()helper.goreleaser.yaml— addedbrews:section (whtssub/homebrew-tap), removedskip_upload: truefromkrews:.github/workflows/release.yml— usesGH_PATsecret for cross-repo writes; falls back toGITHUB_TOKEN
Note: To enable automatic krew and Homebrew pushes, add a
GH_PATsecret to this repo — a PAT withcontents:writeonwhtssub/krew-indexandwhtssub/homebrew-tap.