Skip to content

Modernize CLI: deps, concurrency, and safer exec - #29

Open
cin wants to merge 3 commits into
mainfrom
modernize-cli-hardening
Open

Modernize CLI: deps, concurrency, and safer exec#29
cin wants to merge 3 commits into
mainfrom
modernize-cli-hardening

Conversation

@cin

@cin cin commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

Builds on the Go 1.26 / client-go 0.36 dependency bump with CLI hardening and safer parallel exec behavior.

Dependencies and CI (from modernize-go-k8s-deps)

  • Bump Go to 1.26 and Kubernetes libraries to v0.36.2
  • Fix Dependabot (gomod + github-actions)
  • Refresh PR/release workflows; run go test in CI

Correctness and UX

  • Remove leftover kubeconfig debug print that polluted stdout
  • Replace panics with stderr messages and os.Exit(1)
  • Preserve captured stdout/stderr when an exec stream fails
  • Stop treating non-empty stderr as a hard failure (align with kubectl); merge stderr into displayed output
  • Exit non-zero if any pod exec fails
  • Fix error reporting so per-pod failures show the real error (not <nil>)

Performance and scale

  • Add -j concurrency limit (default 16; 0 = unlimited) with a worker semaphore
  • Tune client-go QPS/Burst to match concurrency
  • Add -timeout for per-pod exec deadlines
  • Pass only pod name/namespace into workers

Exec transport and hygiene

  • Prefer WebSocket with SPDY fallback via NewFallbackExecutor
  • Replace manual sort.Interface with slices.SortFunc
  • Drop unused ANSI color constants
  • Extend unit tests; add .gitignore; clean up README (document new flags, remove stale “possible features”)

Test plan

  • go test ./...
  • go build
  • go vet ./...
  • Manual smoke against a cluster: kubectl-parallel-exec -c <ctr> -l <sel> -j 2 -- true
  • Confirm failing command exits 1 and prints the real error (not <nil>)
  • Confirm stderr-only successful commands are not treated as failures

Made with Cursor

cin and others added 3 commits June 21, 2026 00:02
Co-authored-by: Cursor <cursoragent@cursor.com>
Cap concurrent execs, use WebSocket+SPDY fallback, stop panicking on
setup errors, and exit non-zero when any pod fails.

Co-authored-by: Cursor <cursoragent@cursor.com>
Surface both kubeconfig and in-cluster errors on config failure, stop
copying bytes.Buffer by value, use cmp.Compare for sorting, ensure pod
output ends with a newline, run tests with -race, and pin golangci-lint.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant