Skip to content

oc __custom_func clobbers kubectl __custom_func #371

Description

@commonquail

kubectls Bash completion defines a function creatively named __custom_func, which serves as a sort of entry point to certain kubectl commands (config, create, get, etc.). Not all, and it's not entirely clear whether there is a pattern to the covered commands.

I've verified this in kubectl v1.11.0+d4cacc0 and v1.14.0.

oc' s Bash completion also defines a function named __custom_func, and it serves exactly the same purpose for oc as kubectl's __custom_func serves for kubectl. Because "o" comes after "k", oc's __custom_func clobbers kubectl's. While we can largely use oc as a proxy for kubectl, kubectl's completion is considerably more refined than oc's completion of kubectl's operations; for instance, context completion.

I've verified this only in oc v3.11.0+0cbc58b but it is evidently still true. It looks to the naked eye as if it can be trivially renamed.

Of course, it doesn't really matter which function clobbers which because both kubectl and oc are being bad citizens. It surprises me that either tool has gotten away with an unnamespaced function for so long, especially considering that the other more than 400 total functions are all properly namespaced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions