From 07195ff09fdcb0d2d3a044c92665b082d6e742b1 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Wed, 16 Oct 2019 12:00:12 -0400 Subject: API: report multiple digests for images Be prepared to report multiple image digests for images which contain multiple manifests but, because they continue to have the same set of layers and the same configuration, are considered to be the same image. Signed-off-by: Nalin Dahyabhai --- cmd/podman/images.go | 16 ++++++++++------ cmd/podman/varlink/io.podman.varlink | 3 ++- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'cmd/podman') diff --git a/cmd/podman/images.go b/cmd/podman/images.go index e363fa3bb..6bb08e195 100644 --- a/cmd/podman/images.go +++ b/cmd/podman/images.go @@ -27,6 +27,7 @@ type imagesTemplateParams struct { Tag string ID string Digest digest.Digest + Digests []digest.Digest Created string CreatedTime time.Time Size string @@ -34,12 +35,13 @@ type imagesTemplateParams struct { } type imagesJSONParams struct { - ID string `json:"id"` - Name []string `json:"names"` - Digest digest.Digest `json:"digest"` - Created time.Time `json:"created"` - Size *uint64 `json:"size"` - ReadOnly bool `json:"readonly"` + ID string `json:"id"` + Name []string `json:"names"` + Digest digest.Digest `json:"digest"` + Digests []digest.Digest `json:"digests"` + Created time.Time `json:"created"` + Size *uint64 `json:"size"` + ReadOnly bool `json:"readonly"` } type imagesOptions struct { @@ -290,6 +292,7 @@ func getImagesTemplateOutput(ctx context.Context, images []*adapter.ContainerIma Tag: tag, ID: imageID, Digest: img.Digest(), + Digests: img.Digests(), CreatedTime: createdTime, Created: units.HumanDuration(time.Since(createdTime)) + " ago", Size: sizeStr, @@ -321,6 +324,7 @@ func getImagesJSONOutput(ctx context.Context, images []*adapter.ContainerImage) ID: img.ID(), Name: img.Names(), Digest: img.Digest(), + Digests: img.Digests(), Created: img.Created(), Size: size, ReadOnly: img.IsReadOnly(), diff --git a/cmd/podman/varlink/io.podman.varlink b/cmd/podman/varlink/io.podman.varlink index 9ec7d1172..f9339fccb 100644 --- a/cmd/podman/varlink/io.podman.varlink +++ b/cmd/podman/varlink/io.podman.varlink @@ -58,7 +58,8 @@ type VolumeRemoveOpts ( type Image ( id: string, - digest: string, + digest: string, + digests: []string, parentId: string, repoTags: []string, repoDigests: []string, -- cgit v1.2.3-54-g00ecf