tink icon indicating copy to clipboard operation
tink copied to clipboard

tink-cli hardware get returns 1 row per interface per hardware

Open splaspood opened this issue 4 years ago • 2 comments

When you issue a tink-cli hardware get the output consists of a table where there is one row per interface per piece of hardware. So if you have a piece of hardware with 3 network interfaces the resulting table will contain 3 rows for that single piece of hardware. This does not seem to meet with the user's expectations of output from this command.

Expected Behaviour

'tink-cli hardware get' should return a list of all hardware within tink-server, one row per piece of hardware.

Current Behaviour

'tink-cli hardware get' returns 1 row for each interface of each piece of hardware: eg:

+--------------------------------------+-------------------+----------------+----------+ | ID | MAC ADDRESS | IP ADDRESS | HOSTNAME | +--------------------------------------+-------------------+----------------+----------+ | 35913e1c-3c24-4046-bbbb-db1122d495dd | e4:43:4b:4b:5e:e0 | 172.16.4.237 | | | 35913e1c-3c24-4046-bbbb-db1122d495dd | e4:43:4b:4b:5e:e1 | | | | 35913e1c-3c24-4046-bbbb-db1122d495dd | e4:43:4b:4b:5e:e2 | | | | 35913e1c-3c24-4046-bbbb-db1122d495dd | e4:43:4b:4b:5e:e3 | | | | 35913e1c-3c24-4046-bbbb-db1122d495dd | 4c:d9:8f:23:2c:b0 | 10.229.12.22 | |

Possible Solution

hardware get should return a single row per piece of hardware. Since the default columns currently includes 'mac address', and 'ip address' the data returned would have to change. Maybe 'mac address(es)' and 'ip address(es)'.

Steps to Reproduce (for bugs)

Run 'tink-cli hardware get'

Context

While tink-cli hardware get is still fully usable in this state the output, I feel, is inconsistent with user expectations and will lead to confusion when attempting to use the CLI to troubleshoot.

splaspood avatar Sep 02 '21 17:09 splaspood

This does make a lot of sense, the cli call was for hardware not nics or network info so the output should be hardware (id) centric.

mmlb avatar Sep 02 '21 17:09 mmlb

https://github.com/tinkerbell/tink/blob/775d2709b82e05f65c8c21149fa2aeb34c67a930/cmd/tink-cli/cmd/hardware/get.go#L51 not the first to notice this issue :)

splaspood avatar Sep 04 '21 23:09 splaspood

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

jacobweinstock avatar Dec 23 '22 01:12 jacobweinstock