From 6f27dddf93d68cea2a24f76f9ad63588faf74b71 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Thu, 17 Aug 2017 14:24:25 -0400 Subject: [PATCH] kpod images: output multiple image names Output multiple image names, if we have more than one. Signed-off-by: Nalin Dahyabhai --- cmd/kpod/images.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/kpod/images.go b/cmd/kpod/images.go index 457f9d8d..775ff679 100644 --- a/cmd/kpod/images.go +++ b/cmd/kpod/images.go @@ -137,9 +137,9 @@ func outputImages(store storage.Store, images []storage.Image, truncate, digests } createdTime := img.Created - name := "" + names := []string{""} if len(img.Names) > 0 { - name = img.Names[0] + names = img.Names } info, imageDigest, size, _ := libkpodimage.InfoAndDigestAndSize(store, img) @@ -149,7 +149,7 @@ func outputImages(store storage.Store, images []storage.Image, truncate, digests params := imageOutputParams{ ID: img.ID, - Name: name, + Name: names, Digest: imageDigest, CreatedAt: createdTime.Format("Jan 2, 2006 15:04"), Size: libkpodimage.FormattedSize(float64(size)), @@ -173,7 +173,7 @@ func outputImages(store storage.Store, images []storage.Image, truncate, digests type imageOutputParams struct { ID string `json:"id"` - Name string `json:"names"` + Name []string `json:"names"` Digest digest.Digest `json:"digest"` CreatedAt string `json:"created"` Size string `json:"size"`