diff options
author | Valentin Rothberg <vrothberg@redhat.com> | 2022-04-08 09:52:55 +0200 |
---|---|---|
committer | Valentin Rothberg <vrothberg@redhat.com> | 2022-04-08 10:09:38 +0200 |
commit | e133a06d2f4a3e94bfbd60b647046f2f515c9c24 (patch) | |
tree | 303888c404656f78af9b1a2b3e577386bf68cc96 /cmd/podman | |
parent | 4bd35cb01f03fd90ff304f666e53fcd222ad77f9 (diff) | |
download | podman-e133a06d2f4a3e94bfbd60b647046f2f515c9c24.tar.gz podman-e133a06d2f4a3e94bfbd60b647046f2f515c9c24.tar.bz2 podman-e133a06d2f4a3e94bfbd60b647046f2f515c9c24.zip |
images --size
Add a --size option to podman images to allow for disabling computing
the size of listed images. If listing images is critical to
performance, user may chose to turn off size computation to speed things
up.
Context: #13755
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/images/list.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/podman/images/list.go b/cmd/podman/images/list.go index 9bddf1cff..10a2a4f87 100644 --- a/cmd/podman/images/list.go +++ b/cmd/podman/images/list.go @@ -87,6 +87,7 @@ func imageListFlagSet(cmd *cobra.Command) { flags := cmd.Flags() flags.BoolVarP(&listOptions.All, "all", "a", false, "Show all images (default hides intermediate images)") + flags.BoolVarP(&listOptions.Size, "size", "", true, "Compute the size of each image") filterFlagName := "filter" flags.StringSliceVarP(&listOptions.Filter, filterFlagName, "f", []string{}, "Filter output based on conditions provided (default [])") @@ -320,7 +321,10 @@ func lsFormatFromFlags(flags listFlagType) string { row = append(row, "{{.Digest}}") } - row = append(row, "{{.ID}}", "{{.Created}}", "{{.Size}}") + row = append(row, "{{.ID}}", "{{.Created}}") + if listOptions.Size { + row = append(row, "{{.Size}}") + } if flags.history { row = append(row, "{{if .History}}{{.History}}{{else}}<none>{{end}}") |