tink icon indicating copy to clipboard operation
tink copied to clipboard

Implement tink-cli describe command

Open gianarb opened this issue 4 years ago • 6 comments

As part of #425 #406, we would like to have a describe command.

Similar requirements as #425

  1. 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 for get, and I mean Options if necessary for example
  2. 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 for get 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
}

gianarb avatar Jan 27 '21 12:01 gianarb

I'm going to grab and work on this.

mazzy89 avatar Jan 27 '21 12:01 mazzy89

@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?

mazzy89 avatar Feb 05 '21 13:02 mazzy89

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 .

gianarb avatar Feb 05 '21 15:02 gianarb

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.

mazzy89 avatar Feb 05 '21 15:02 mazzy89

I agree 100%, avoid any use of table!!

gianarb avatar Feb 05 '21 15:02 gianarb

@mazzy89 - are you still working on this? I think it would be a great addition to Tinkerbell.

tstromberg avatar Aug 27 '21 15:08 tstromberg

closed by https://github.com/tinkerbell/tink/pull/654

jacobweinstock avatar Dec 23 '22 02:12 jacobweinstock