Add completion spec: openshift (oc)#213
Closed
zachlloyd wants to merge 1 commit into
Closed
Conversation
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>
APP-3507 Add OpenShift (oc) completion spec
No completion spec exists for See GitHub #4147, #5073 |
Contributor
|
Closing to retry with full skill access. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an
occompletion spec for the OpenShift CLI, addressing #4147 and #5073.Since
ocis a superset ofkubectl(both Cobra-based, same__completeprotocol), this:JSON spec (
oc.json)kubectl.jsonwith all shared subcommandslogin,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, andadm(with nestedpolicy,groups,drain,cordon,uncordon,inspect,top,node-logs,build-chain,must-gather)Generators (
oc.rs)ocbinary:resource_type,running_pods,deployments,node,cluster_role,role,resource,context,cluster,namespace,type_or_type_slash_name, andoc_builtin_completion(Cobra__completeprotocol)Refactor (
kubectl.rs)kube_cli_script,kube_cli_post_process,kube_cli_builtin_complete_post_process) aspub(super)so both kubectl and oc can reuse themValidation
script/presubmitpasses (formatting, clippy, all 11 tests including generator name validation)ocinstalledConversation: 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.