Skip to content

fix(kubectl): compact get pods and services aliases - #1720

Merged
aeppling merged 1 commit into
rtk-ai:developfrom
pagarsky:fix/kubectl-get-alias
May 17, 2026
Merged

aeppling merged 1 commit into
rtk-ai:developfrom
pagarsky:fix/kubectl-get-alias

Conversation

@pagarsky

@pagarsky pagarsky commented May 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Route rtk kubectl get pods / get services aliases through the existing compact pod and service filters.
  • Preserve raw kubectl passthrough for unsupported resources and explicit output/detail/watch flags such as -o name or --watch.
  • Add unit coverage for the new get parser path and kubectl resource alias routing.

Context

RTK's hook already rewrites kubectl get pods to rtk kubectl get pods, but that form currently falls through to raw kubectl output instead of using the compact pod/service filters. This made rtk gain show little or no savings for kubectl-heavy sessions, even though kubectl is listed as a supported infrastructure command.

This PR keeps the existing rewrite shape and makes rtk kubectl get pods / get services use the same compact filters as rtk kubectl pods / services. Explicit output/detail flags like -o name still pass through raw kubectl output.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --all-targets -- -D unsafe_code
  • cargo test --all
  • Manual testing: ./target/debug/rtk kubectl get pods, ./target/debug/rtk kubectl get svc, ./target/debug/rtk kubectl get pods -o name

Made with Cursor

@CLAassistant

CLAassistant commented May 5, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@vladikkuzn

Copy link
Copy Markdown

PTAL @aeppling @pszymkowiak or suggest some advice to move this PR forward

@aeppling aeppling self-assigned this May 16, 2026
@aeppling

Copy link
Copy Markdown
Contributor

Hey @pagarsky , thanks for your contribution !

If you can rebase on develop / solve conflict LGTM for next release :)

@pagarsky
pagarsky force-pushed the fix/kubectl-get-alias branch from edc4440 to b8172e5 Compare May 16, 2026 20:00
@pagarsky

Copy link
Copy Markdown
Contributor Author

@aeppling rebased, should be good to go. Thanks for you work! 👍

@aeppling

Copy link
Copy Markdown
Contributor

Thanks for contributing to RTK @pagarsky !

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.

4 participants