summaryrefslogtreecommitdiff
path: root/libpod/image/image.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/image/image.go')
-rw-r--r--libpod/image/image.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go
index c8583a1c5..6ea49e2a9 100644
--- a/libpod/image/image.go
+++ b/libpod/image/image.go
@@ -781,6 +781,7 @@ type History struct {
CreatedBy string `json:"createdBy"`
Size int64 `json:"size"`
Comment string `json:"comment"`
+ Tags []string `json:"tags"`
}
// History gets the history of an image and the IDs of images that are part of
@@ -840,14 +841,17 @@ func (i *Image) History(ctx context.Context) ([]*History, error) {
delete(topLayerMap, layer.ID)
}
}
-
- allHistory = append(allHistory, &History{
+ h := History{
ID: id,
Created: oci.History[x].Created,
CreatedBy: oci.History[x].CreatedBy,
Size: size,
Comment: oci.History[x].Comment,
- })
+ }
+ if layer != nil {
+ h.Tags = layer.Names
+ }
+ allHistory = append(allHistory, &h)
if layer != nil && layer.Parent != "" && !oci.History[x].EmptyLayer {
layer, err = i.imageruntime.store.Layer(layer.Parent)
@@ -898,8 +902,7 @@ func (i *Image) Annotations(ctx context.Context) (map[string]string, error) {
}
}
annotations := make(map[string]string)
- switch manifestType {
- case ociv1.MediaTypeImageManifest:
+ if manifestType == ociv1.MediaTypeImageManifest {
var m ociv1.Manifest
if err := json.Unmarshal(imageManifest, &m); err == nil {
for k, v := range m.Annotations {
@@ -1007,6 +1010,7 @@ func (i *Image) Inspect(ctx context.Context) (*inspect.ImageData, error) {
ManifestType: manifestType,
User: ociv1Img.Config.User,
History: ociv1Img.History,
+ NamesHistory: i.NamesHistory(),
}
return data, nil
}
@@ -1523,7 +1527,7 @@ func GetLayersMapWithImageInfo(imageruntime *Runtime) (map[string]*LayerInfo, er
}
}
- // scan all layers & add all childs for each layers to layerInfo
+ // scan all layers & add all childid's for each layers to layerInfo
for _, layer := range layers {
_, ok := layerInfoMap[layer.ID]
if ok {