summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2019-06-24 17:59:08 -0400
committerNalin Dahyabhai <nalin@redhat.com>2019-06-26 10:43:04 -0400
commit1ebb84b58eb3531cd22a49a4d0ce497b9b356d90 (patch)
treee8dd3a5807ca713d8c3d8a760ad83a5ff0f42bd2 /cmd/podman
parent8e79de284865957fffc898b16410a212c1c33fc7 (diff)
downloadpodman-1ebb84b58eb3531cd22a49a4d0ce497b9b356d90.tar.gz
podman-1ebb84b58eb3531cd22a49a4d0ce497b9b356d90.tar.bz2
podman-1ebb84b58eb3531cd22a49a4d0ce497b9b356d90.zip
Handle images which contain no layers
This fixes some of our handling of images which have no layers, i.e., those whose TopLayer is set to an empty value. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/tree.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/podman/tree.go b/cmd/podman/tree.go
index 6490c609d..0f62858e8 100644
--- a/cmd/podman/tree.go
+++ b/cmd/podman/tree.go
@@ -72,7 +72,11 @@ func printTree(imageInfo *image.InfoImage, layerInfoMap map[string]*image.LayerI
fmt.Printf("Image ID: %s\n", imageInfo.ID[:12])
fmt.Printf("Tags:\t %s\n", imageInfo.Tags)
fmt.Printf("Size:\t %v\n", units.HumanSizeWithPrecision(float64(*size), 4))
- fmt.Printf(fmt.Sprintf("Image Layers\n"))
+ if img.TopLayer() != "" {
+ fmt.Printf("Image Layers\n")
+ } else {
+ fmt.Printf("No Image Layers\n")
+ }
if !whatRequires {
// fill imageInfo with layers associated with image.