Skip to content

v0.2.4

Latest

Choose a tag to compare

@github-actions github-actions released this 05 May 17:03
fea6606

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-Expression

SARIF 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.sarif

Rules 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 snapshot

Checksums 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.txt

Internals

  • internal/cli/completion.go — Cobra's built-in GenBashCompletionV2 / GenZshCompletion / GenFishCompletion / GenPowerShellCompletionWithDesc
  • internal/snapshot/sarif.gorenderSARIF(), sarifRules catalogue, extractResourceFromIssue() helper
  • .goreleaser.yaml — added brews: section (whtssub/homebrew-tap), removed skip_upload: true from krews:
  • .github/workflows/release.yml — uses GH_PAT secret for cross-repo writes; falls back to GITHUB_TOKEN

Note: To enable automatic krew and Homebrew pushes, add a GH_PAT secret to this repo — a PAT with contents:write on whtssub/krew-index and whtssub/homebrew-tap.