zot icon indicating copy to clipboard operation
zot copied to clipboard

[Bug]: zli image output column headers are not aligned with output and unfriendly to cli parsing

Open raharper opened this issue 1 year ago • 4 comments

zot version

{"level":"info","distribution-spec":"1.1.0-dev","commit":"v2.0.0-rc5-0-g8cc5137","binary-type":"-lint-metrics-mgmt-scrub-search-sync-ui-userprefs","go version":"go1.20.5","time":"2023-07-07T09:57:33-05:00","message":"version"}

Describe the bug

zli image repoName --name foo produces hard-to-read output due to the header columns not being aligned with the actual output data.

IMAGE NAME  TAG       OS/ARCH	      DIGEST	  SIGNED      SIZE
aaaaaa/bbbbbbb  8-dev17-213-g40ecfd036  linux/amd64	 9dd8c9ed    false	 264MB
aaaaaa/bbbbbbb  8-dev17-201-gda3c8bebc-squashfs  linux/amd64	  e6267429    false	  249MB

Using something like column -t should just work but the 'IMAGE NAME' has whitespace and breaks the alignment

IMAGE            NAME                             TAG          OS/ARCH   DIGEST  SIGNED  SIZE
aaaaaa/bbbbbbbb  8-dev17-184-g7305cd43d-squashfs  linux/amd64  3f0900f9  false   249MB
aaaaaa/bbbbbbbb  8-dev17-201-gda3c8bebc-squashfs  linux/amd64  e6267429  false   249MB

Further, the response from zot is not sorted, so re-running the same query results in different output order.



### To reproduce

1. Configuration
2. Client tool used
3. Seen error


### Expected behavior

IMAGE TAG OS/ARCH DIGEST SIGNED SIZE aaaaaa/bbbbbbbb 8-dev17-186-gf8fcb1a8c linux/amd64 a4a4db0c false 264MB aaaaaa/bbbbbbbb 8-dev17-188-gc957bbb39 linux/amd64 7375c7ce false 264MB aaaaaa/bbbbbbbb 8-dev17-188-gc957bbb39-squashfs linux/amd64 f897f638 false 249MB


### Screenshots

_No response_

### Additional context

_No response_

raharper avatar Jul 07 '23 15:07 raharper