Skip to content

feat(oc): add Openshift CLI support with shared k8s filtering - #2243

Merged
aeppling merged 1 commit into
rtk-ai:developfrom
Alcamech:feat/oc-support
Jun 18, 2026
Merged

aeppling merged 1 commit into
rtk-ai:developfrom
Alcamech:feat/oc-support

Conversation

@Alcamech

@Alcamech Alcamech commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add OpenShift CLI (oc) support: oc get pods, oc get services, and oc logs now get the same compact filtering as their kubectl equivalents
  • Generalize kubectl helpers (k8s_pods, k8s_services, k8s_logs) to accept a tool parameter, enabling code reuse between kubectl and oc
  • Add rewrite rule in discover/rules.rs so hooks auto-rewrite oc commands to rtk oc

Test plan

  • cargo fmt --all && cargo clippy --all-targets && cargo test — 1949 tests pass
  • Manual testing: rtk oc get pods -n openshift-monitoring produces filtered summary
  • Manual testing: rtk oc get services -n openshift-monitoring produces compact service list
  • Manual testing: rtk oc new-project test passes through via external_subcommand
  • Token savings test: ≥60% savings verified with real sanitized fixture from ROSA HCP cluster
  • rtk gain confirms oc commands tracked with >0% savings

Scoping

As per the scope rules, I tried to focus this PR to adding initial functionality for oc support through the k8s-shared commands only (pods, services, logs). oc-specific resource filters (routes, imagestreams, etc.) can come from follow-up PRs.

@CLAassistant

CLAassistant commented Jun 3, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Alcamech
Alcamech force-pushed the feat/oc-support branch 2 times, most recently from 2a79d55 to 04d32cb Compare June 12, 2026 17:31
@aeppling aeppling self-assigned this Jun 18, 2026
@aeppling

Copy link
Copy Markdown
Contributor

Hey @Alcamech , went through the PR all looks good, did not try the full circle with the oc CLI , trusting your knowledge on this part for oc filtering and fixtures

Thanks for the clean contribution, well scoped and using existing infrastructure with shared runners and tee hint functions

@aeppling
aeppling merged commit 39cbb96 into rtk-ai:develop Jun 18, 2026
11 checks passed
@aeppling aeppling mentioned this pull request Jun 19, 2026
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.

3 participants