summaryrefslogtreecommitdiff
path: root/vendor/github.com/containers/common/libimage
diff options
context:
space:
mode:
authorValentin Rothberg <vrothberg@redhat.com>2023-05-02 13:57:43 +0200
committerValentin Rothberg <vrothberg@redhat.com>2023-05-02 16:21:09 +0200
commit9e9bcec9ece8e1986c3067e4da50734589450cb1 (patch)
tree5280bc976d13b3c16a922b4f4be732f4a1dc58c1 /vendor/github.com/containers/common/libimage
parent91da62d74c82bf6c30245c4d49faa902102b00f5 (diff)
history: correctly set tags
Requires vendoring fixes from c/common and to update the transformation code. Also add a test to avoid future regressions. Fixes: #17763 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Diffstat (limited to 'vendor/github.com/containers/common/libimage')
-rw-r--r--vendor/github.com/containers/common/libimage/history.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/vendor/github.com/containers/common/libimage/history.go b/vendor/github.com/containers/common/libimage/history.go
index 46252df10..ad989b528 100644
--- a/vendor/github.com/containers/common/libimage/history.go
+++ b/vendor/github.com/containers/common/libimage/history.go
@@ -51,7 +51,6 @@ func (i *Image) History(ctx context.Context) ([]ImageHistory, error) {
}
if layer != nil {
- history.Tags = layer.Names
if !ociImage.History[x].EmptyLayer {
history.Size = layer.UncompressedSize
}
@@ -64,8 +63,13 @@ func (i *Image) History(ctx context.Context) ([]ImageHistory, error) {
history.ID = id
usedIDs[id] = true
}
+ for i := range node.images {
+ history.Tags = append(history.Tags, node.images[i].Names()...)
+ }
}
- if layer.Parent != "" && !ociImage.History[x].EmptyLayer {
+ if layer.Parent == "" {
+ layer = nil
+ } else if !ociImage.History[x].EmptyLayer {
layer, err = i.runtime.store.Layer(layer.Parent)
if err != nil {
return nil, err