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

Change "get" to "list" #128

Closed
duglin opened this issue May 19, 2019 · 8 comments · Fixed by #180
Closed

Change "get" to "list" #128

duglin opened this issue May 19, 2019 · 8 comments · Fixed by #180

Comments

@duglin
Copy link
Contributor

duglin commented May 19, 2019

Proposal: change get to list

When people want to list the set of services running I think kn service list is more natural for people. I know this is more of a personal preference kind of thing, especially when you consider that kubectl actually uses get for both (lists and singular), but if you think about how all of the kn service verbs act on a single instance of a service, get would therefore imply "get me info about A service". While, the word list more naturally implies you want a "list" of something back.... in this case services.

Net: change it to: kn service list to see all services.

Same should apply to the other nouns as well.

@rhuss
Copy link
Contributor

rhuss commented May 19, 2019

FYI, we already had the reverse discussion starting at #48 (comment) and decided in the WG meeting on 2019-04-23 to go with get over list (to be in alignment to kubernetes and following the principle of least surprise even when we do not 100% like the way kubectl does it).

We can revisit this decision, but at the moment get is mostly for an overview and machine-readable output (like with -o yaml) and describe for human-readable detail output of a single service (like in kubectl).

@duglin
Copy link
Contributor Author

duglin commented May 28, 2019

I wouldn't compare things to kubectl since kubectl is kind of odd in this respect. Sometimes it GETs a single thing, sometimes it GETs multiple - then add in the optional "s" at the end of the resource type - and I wouldn't call it the most UX-friendly. I view kn (like knative) as a better UX thank vanilla Kube. So I was hoping we could do better than the CRUD-like interface of kubectl.

@rhuss rhuss mentioned this issue Jun 2, 2019
@rhuss
Copy link
Contributor

rhuss commented Jun 3, 2019

I went now back and forth with this UX issue, and I tend to agree with @duglin Although I still think that the 'principle of least suprise' is still a good thing, I'm by no means sure anymore whether it applies to kubectl vs. kn:

  • kn and kubectl are already called differently: (kubectl) vs (kn). Adding a similar behaviour afterwards for "get" is probably much more confusing than to make a clear cut.
  • Also some code is shared (i.e. the one for machine readable output), the target audience is different enough to justify a different UX style, too.

As I had now the chance to play around quite a bit with kn, I'd like to make the following suggestion for a kind of compromise, but still with a clear theme:

  • kn service list <filter> for listing plain services. The filter should be a "contains" or "prefix" filter so that kn serivce list <name> will return exactly the single service. This is similar to kubectl get kservice, but with a clear focus on the "listing"
  • kn service get <name> allows a single argument, the name of a service. The default output is machine readable (json or yaml). It can be nicely used in scripts. It reflects a pure "get" semantics as known from CRUD.
  • kn service show <name> a pure human readable output (which could be tuned with options for different layouts, see feature(service describe): Output of service details [vanilla, color, hipster] #75 ). It alos contains summaryt information about other related objects (like revisions belonging to this sercice, traffic targets, ...). So it's deliberately named different than a kubectl describe service to make it clear.

My feeling is that these three read-only commands would cover all use cases (searching/listing, getting a json for scripting, human readable output in different flavors) in a nicely separated way.

Wdyt ? Would it be worth to reconsider our initial decision to kn service get over kn service list ?

@duglin
Copy link
Contributor Author

duglin commented Jun 4, 2019

No surprise :-) but I agree with the "list" and "get" parts. I'm not as sure about the "show" one because that feels like a variant of "get", just with a different output format. So, I'd opt to assume humans are our first set of users and that means kn service get <name> should show things in a human readable format by default, but if they specify a flag then they'll get the machine readable version of the same type of output.

btw, I think this same type of flag on kn service list would be good too. I like the idea of adding an -o yaml/json type of flag to most commands so Kn users can easily take what they do by-hand and then turn around and use it in a script by just adding a flag.

@navidshaikh
Copy link
Collaborator

IMO, we should keep only two verbs for readonly listing of resources,

@evankanderson
Copy link
Member

list also needs a human-readable output (e.g. a tabular format).

@sixolet
Copy link
Contributor

sixolet commented Jun 11, 2019 via email

@duglin
Copy link
Contributor Author

duglin commented Jun 13, 2019

thanks y'all!

coryrc pushed a commit to coryrc/client that referenced this issue May 14, 2020
* Add wait for app to be routable function in library

* Add function documentation

* Make log statements better

* Nuke stderr

* Assorted nits

* indentation, punctuation, linefeeds
* add log message about what the function is doing 
* use the same loop pattern as the other functions
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 a pull request may close this issue.

5 participants