don't list plans twice (svcat describe class --traverse) #2026
don't list plans twice (svcat describe class --traverse) #2026
Conversation
Seems simple enough. Are we sure that we always want to print the plans? At that point, traverse is only adding the broker information. I think you might want to remove the line that always prints the plans, and leave the line in the traverse loop. See here for how we do it in |
8b5c41c
to
043c282
Compare
Good point @jberkhahn. I've moved the printing of plans down to the traverse section before the broker details (I think order is best to keep the plan before broker). example output now: $ svcat describe class dh-hello-world-apb
Name: dh-hello-world-apb
Description: deploys hello-world web application
UUID: 9f7da06f179b895a8ee5f9a3ce4af7ef
Status: Active
Tags:
Broker: ansible-service-broker
$ svcat describe class dh-hello-world-apb --traverse
Name: dh-hello-world-apb
Description: deploys hello-world web application
UUID: 9f7da06f179b895a8ee5f9a3ce4af7ef
Status: Active
Tags:
Broker: ansible-service-broker
Plans:
NAME DESCRIPTION
+---------+--------------------------------+
default A sample APB which deploys
Hello World
Broker:
Name: ansible-service-broker
Status: Ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
I would strongly prefer that either a) we get rid of traverse altogether since I'm not sure it provides value or b) always show plans when describing a class and don't double show them when --traverse is specified.
The reason why plans are displayed by default is that it's the more common use case for that command and I wanted to show useful information by default, instead of hiding it behind a flag.
What do you think?
The class and plans do go hand in hand.... I can see reason to include it. Yet, the command says show me the class, not the class and plans. And wouldn't the describe plan duplicate the plan details we include in the describe class? Not that there is anything wrong with multiple ways to get the same info... I'd kind of like a svcat show-me-everything ordered by broker -> class -> plans, but that is beside the point. I guess I was thinking I don't see much use of traverse. |
Now that I think about it, I think it would make the most sense to remove the traverse flag entirely and just show the plan names by default. If the user wants more info on plan foo, they can get plans foo. Also, how are you even supposed to know the traverse flag exists? It doesn't show up when i |
ok, I'm on it, will remove traverse |
describe class just lists the names of the plans associated with the class while describe plan shows additional details about a specific plan, such as parameter schema and eventually defaults and other stuff.
kubectl is a generic cli that doesn't have any domain knowledge, so it does things like "I will only show you the one thing you asked for". It has been my goal with svcat to show you things that are useful and most commonly desired without forcing extra calls or flags, which is why listing the plan names for a class occurs by default. I want to avoid being too pendanic with svcat, so that in order to do a common task someone doesn't have to chain multiple commands together. |
Sorry, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 💯
When you describe a class with --traverse option, the plans are listed twice: