tink
tink copied to clipboard
Implement tink-cli describe command
As part of #425 #406, we would like to have a describe
command.
Similar requirements as #425
- The Describe command should be only one inside a new
cmd/tink-cli/command/describe
package and it should follow the same structure we have forget
, and I meanOptions
if necessary for example - Tests, tests, tests
Use case
The get
command can be used to quickly discover resources but describe will show a single one AND it will work as a troubleshooting tool to know everything we can about that specific resource.
It will work this way:
tink hardware|template|... describe <ID>
It accepts only one ID.
Flags (the one I can think about):
-
--format
as forget
will switch the format. I think we can use "human" as the default one having as alternative JSON and YAML. -
--show-events=true
: If true, display events related to the described object. (directly from kubectl)
I am gonna describe the output with something that looks like JSON only for my simplicity:
{
"data": {}, # the actual resource
"events": [] # list of events for that resource
}
I'm going to grab and work on this.
@gianarb how do we want to make it look like the output of a describe
in the "human" format whenshow-events
flag is set to True
?
I think we should do similar to what Kubernetes does and at the end, we should print:
Events:
event1
event2
event3
To be honest, I don't have a clear answer for how the visualization should look like, so I am open for suggestion!
On Fri, Feb 5, 2021 at 2:41 PM Salvatore Mazzarino [email protected] wrote:
@gianarb https://github.com/gianarb how do we want to make it look like the output of a describe in the "human" format whenshow-events flag is set to True?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tinkerbell/tink/issues/426#issuecomment-774039389, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMOAOZ6AJPXNXHPWCRMN2TS5PYPVANCNFSM4WVEU5CQ .
My suggestion here is to leave behind the table format for the describe
and have as "human" format same as Kubernetes does and include Events at the bottom as you said.
I agree 100%, avoid any use of table!!
@mazzy89 - are you still working on this? I think it would be a great addition to Tinkerbell.
closed by https://github.com/tinkerbell/tink/pull/654