mirror of
https://github.com/containers/podman.git
synced 2025-12-04 20:28:40 +08:00
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>
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user