Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use kubectl common syntax to query resources #22

Open
akram opened this issue Sep 9, 2020 · 2 comments
Open

Use kubectl common syntax to query resources #22

akram opened this issue Sep 9, 2020 · 2 comments

Comments

@akram
Copy link

akram commented Sep 9, 2020

Hi all,

I am new to kubectl operator , so just an RFE to start with: It would be more intuitive to use the common query syntax for the kubectl operator commands:

e.g:
replace:

kubectl operator catalog list -A

with:

kubectl operator get catalogs --all-namespaces
kubectl operator get catalog --all-namespaces
kubectl operator get catalog -A

Same thing for add and remove , that can respectively changed to create and delete

@joelanford
Copy link
Member

This syntax would generally work for the catalog subcommands, but it seems like it breaks down for verbs directly on operators.

Using the example from here, typing operator twice seems like unnecessary repetition to me.

With this plugin, it is difficult to totally align to existing kubectl idioms without introducing this repetition. kubectl subcommands are typically <verb> <noun>, but because this plugin contains so many different verbs, it made more sense to us to flip that and make this plugin use the <noun> <verb> style.

@akram
Copy link
Author

akram commented Sep 10, 2020

Hi @joelanford , yes, this repetition may look a bit heavy in the case you mentionned; but, that's a drawback to have consistency. And this repetition may only occur for operator .
In terms of user experience I am willing to accept this especially, if I have some short names that I can use to avoid this repetition:

kubectl operator get ops
kubectl operator get subs
kubectl operator get cats # not the one you think about 

That would be more convenient for all kubectl/oc users and it will avoid to do a mental gym every time to remember that the order is reversed.
Also, intensive users may for sure, use an alias kop=$(kubectl operator) (if it works, it seems not :-) ) and will do things like:

kop get ops
kop get subs

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

No branches or pull requests

2 participants