Skip to content

Commit c38d916

Browse files
committed
chore: hide STORE column in 'uc images' output if all machines use containerd image store
1 parent 50057c4 commit c38d916

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎cmd/uncloud/image/ls.go‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,14 @@ func formatImageTable(rows []imageRow) string {
260260
columns[5].hide = true
261261
}
262262

263+
// Hide the "STORE" column if all machines use the containerd store.
264+
hasNonContainerd := slices.ContainsFunc(rows, func(r imageRow) bool {
265+
return r.store != "containerd"
266+
})
267+
if !hasNonContainerd {
268+
columns[6].hide = true
269+
}
270+
263271
t := tui.NewTable()
264272

265273
var headers []string

0 commit comments

Comments
 (0)