Skip to content

Add completion spec: openshift (oc)#213

Closed
zachlloyd wants to merge 1 commit into
mainfrom
oz-agent/APP-3507
Closed

Add completion spec: openshift (oc)#213
zachlloyd wants to merge 1 commit into
mainfrom
oz-agent/APP-3507

Conversation

@zachlloyd
Copy link
Copy Markdown
Contributor

Summary

Add an oc completion spec for the OpenShift CLI, addressing #4147 and #5073.

Since oc is a superset of kubectl (both Cobra-based, same __complete protocol), this:

JSON spec (oc.json)

  • Based on kubectl.json with all shared subcommands
  • Adds 20+ OpenShift-specific subcommands: login, logout, whoami, new-project, project, projects, new-app, new-build, start-build, cancel-build, import-image, tag, status, rsh, rsync, extract, idle, observe, process, registry, and adm (with nested policy, groups, drain, cordon, uncordon, inspect, top, node-logs, build-chain, must-gather)

Generators (oc.rs)

  • 12 generators mirroring kubectl's but invoking the oc binary: resource_type, running_pods, deployments, node, cluster_role, role, resource, context, cluster, namespace, type_or_type_slash_name, and oc_builtin_completion (Cobra __complete protocol)

Refactor (kubectl.rs)

  • Exposed shared helpers (kube_cli_script, kube_cli_post_process, kube_cli_builtin_complete_post_process) as pub(super) so both kubectl and oc can reuse them

Validation

  • script/presubmit passes (formatting, clippy, all 11 tests including generator name validation)
  • End-to-end GUI verification of generators should be done by reviewer against a local Warp build with oc installed

Conversation: https://staging.warp.dev/conversation/aa75bd1c-13c7-43cd-be28-15ff381ee916
Run: https://oz.staging.warp.dev/runs/019d473b-6e60-71d8-8ee9-b3bbfd074da8

This PR was generated with Oz.

Add an oc completion spec for the OpenShift CLI. Since oc is a superset
of kubectl (both Cobra-based, same __complete protocol), this:

- Creates oc.json based on kubectl.json with OpenShift-specific
  subcommands: login, logout, whoami, new-project, project, projects,
  new-app, new-build, start-build, cancel-build, import-image, tag,
  status, rsh, rsync, extract, idle, observe, process, registry, and
  adm (with nested policy, groups, drain, cordon, inspect, top, etc.)

- Creates oc.rs generators that mirror kubectl's but invoke the oc
  binary directly for dynamic completions (resource types, pods,
  deployments, nodes, roles, contexts, clusters, namespaces, and
  Cobra __complete protocol)

- Refactors kubectl.rs to expose shared helper functions
  (kube_cli_script, kube_cli_post_process,
  kube_cli_builtin_complete_post_process) as pub(super) so both
  kubectl and oc generators can reuse them without duplication

- Registers the oc module in generators/mod.rs

Closes warpdotdev/warp#4147
Closes warpdotdev/warp#5073

Co-Authored-By: Oz <oz-agent@warp.dev>
@linear
Copy link
Copy Markdown

linear Bot commented Apr 1, 2026

APP-3507 Add OpenShift (oc) completion spec

No completion spec exists for oc, despite it being nearly identical to kubectl (both Cobra-based, same __complete protocol). Can likely reuse kubectl spec + generators as a starting point.

See GitHub #4147, #5073

@lucieleblanc
Copy link
Copy Markdown
Contributor

Closing to retry with full skill access.

@lucieleblanc lucieleblanc deleted the oz-agent/APP-3507 branch April 1, 2026 18:49
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.

2 participants